|
| 1 | +#![feature(extern_types)] |
| 2 | +#![feature(rustc_private)] |
| 3 | +#![feature(register_tool)] |
| 4 | +#![register_tool(c2rust)] |
| 5 | +#![allow(non_upper_case_globals)] |
| 6 | +#![allow(non_camel_case_types)] |
| 7 | +#![allow(non_snake_case)] |
| 8 | +#![allow(dead_code)] |
| 9 | +#![allow(mutable_transmutes)] |
| 10 | +#![allow(unused_mut)] |
| 11 | + |
| 12 | +pub mod bar { |
| 13 | + #[c2rust::header_src = "/home/user/some/workspace/foobar/bar.h:5"] |
| 14 | + pub mod bar_h { |
| 15 | + #[derive(Clone, Copy)] |
| 16 | + #[repr(transparent)] |
| 17 | + #[c2rust::src_loc = "14:0"] |
| 18 | + pub struct C2Rust_Unnamed_2(pub ::core::ffi::c_uint); |
| 19 | + |
| 20 | + #[c2rust::src_loc = "14:0"] |
| 21 | + impl C2Rust_Unnamed_2 { |
| 22 | + #[c2rust::src_loc = "15:0"] |
| 23 | + pub const U: Self = Self(42); |
| 24 | + } |
| 25 | + |
| 26 | + #[derive(Clone, Copy)] |
| 27 | + #[repr(transparent)] |
| 28 | + #[c2rust::src_loc = "11:0"] |
| 29 | + pub struct SomeEnum(pub ::core::ffi::c_uint); |
| 30 | + |
| 31 | + #[c2rust::src_loc = "11:0"] |
| 32 | + impl SomeEnum { |
| 33 | + #[c2rust::src_loc = "12:0"] |
| 34 | + pub const A: Self = Self(0); |
| 35 | + #[c2rust::src_loc = "13:0"] |
| 36 | + pub const B: Self = Self(1); |
| 37 | + } |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +pub mod foo { |
| 42 | + #[c2rust::header_src = "/home/user/some/workspace/foobar/bar.h:5"] |
| 43 | + pub mod bar_h { |
| 44 | + #[derive(Clone, Copy)] |
| 45 | + #[repr(transparent)] |
| 46 | + #[c2rust::src_loc = "4:0"] |
| 47 | + pub struct C2Rust_Unnamed_3(pub ::core::ffi::c_uint); |
| 48 | + |
| 49 | + #[c2rust::src_loc = "4:0"] |
| 50 | + impl C2Rust_Unnamed_3 { |
| 51 | + #[c2rust::src_loc = "5:0"] |
| 52 | + pub const V: Self = Self(42); |
| 53 | + } |
| 54 | + |
| 55 | + #[derive(Clone, Copy)] |
| 56 | + #[repr(transparent)] |
| 57 | + #[c2rust::src_loc = "1:0"] |
| 58 | + pub struct SomeEnum(pub ::core::ffi::c_uint); |
| 59 | + |
| 60 | + #[c2rust::src_loc = "1:0"] |
| 61 | + impl SomeEnum { |
| 62 | + #[c2rust::src_loc = "2:0"] |
| 63 | + pub const A: Self = Self(0); |
| 64 | + #[c2rust::src_loc = "3:0"] |
| 65 | + pub const B: Self = Self(1); |
| 66 | + } |
| 67 | + } |
| 68 | + |
| 69 | + unsafe fn foo() { |
| 70 | + let e1 = super::foo::bar_h::SomeEnum::A; |
| 71 | + let e2 = super::bar::bar_h::SomeEnum::B; |
| 72 | + let e3 = super::bar::bar_h::C2Rust_Unnamed_2::U; |
| 73 | + let e4 = super::foo::bar_h::C2Rust_Unnamed_3::V; |
| 74 | + } |
| 75 | +} |
| 76 | + |
| 77 | +fn main() { |
| 78 | + println!("hello!"); |
| 79 | +} |
0 commit comments