Skip to content

References in enum fields not supported? #485

@sirwhinesalot

Description

@sirwhinesalot

The docs say references are supported and translated to pointer types, but it does not say under which conditions that is the case. I am trying to expose the following tagged union:

#[repr(C)]
pub enum BoolOp<'a> {
    Lit {value: bool},
    And {left: &'a BoolOp<'a>, right: &'a BoolOp<'a>},
}

This generates nothing in the exported header, not even an opaque type. The type only shows up in function parameters and return types.

I'd rather not replace the references with pointers and ruin the ergonomics on the Rust side of things. What should I do?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions