typedef enum { A } E;
int foo(void) {
return A;
}
#![allow(
dead_code,
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
unused_assignments,
unused_mut
)]
pub type C2Rust_Unnamed = ::core::ffi::c_uint;
pub const A: C2Rust_Unnamed = 0;
#[no_mangle]
pub unsafe extern "C" fn foo() -> ::core::ffi::c_int {
return A as ::core::ffi::c_int;
}
Rather than keeping the name E, the typedef's name is being lost here, and the enum is instead being translated as a regular anonymous enum. Seems likely related to the code that prunes unwanted declarations? It is probably eliminating the typedef because it's not used anywhere.
Rather than keeping the name
E, the typedef's name is being lost here, and the enum is instead being translated as a regular anonymous enum. Seems likely related to the code that prunes unwanted declarations? It is probably eliminating the typedef because it's not used anywhere.