]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-28983.rs
Auto merge of #79113 - andjo403:raw_vec_ptr, r=m-ou-se
[rust.git] / src / test / ui / issues / issue-28983.rs
1 // run-pass
2 pub trait Test { type T; }
3
4 impl Test for u32 {
5     type T = i32;
6 }
7
8 pub mod export {
9     #[no_mangle]
10     pub extern "C" fn issue_28983(t: <u32 as ::Test>::T) -> i32 { t*3 }
11 }
12
13 // to test both exporting and importing functions, import
14 // a function from ourselves.
15 extern "C" {
16     fn issue_28983(t: <u32 as Test>::T) -> i32;
17 }
18
19 fn main() {
20     assert_eq!(export::issue_28983(2), 6);
21     assert_eq!(unsafe { issue_28983(3) }, 9);
22 }