cxx/tests/ui/data_enums.rs
Joel Galenson c03402aee5 Support C-style enums
This adds support for passing C-style enums between Rust and C++.

We use the Rust representation for enums suggested by dtolnay in #132.
Note that as this does not use real enums, Rust code cannot treat them
as normal enums, e.g., by converting them to integers.  But common
uses such as pattern matching remain unchanged.
2020-04-30 14:12:37 -07:00

9 lines
80 B
Rust

#[cxx::bridge]
mod ffi {
enum A {
Field(u64),
}
}
fn main() {}