]> git.lizzy.rs Git - rust.git/blob - src/test/ui/no-mangle-associated-fn.rs
e9c621914b2132f3086ff17e8a057b27e59c3c0d
[rust.git] / src / test / ui / no-mangle-associated-fn.rs
1 // aux-build: no-mangle-associated-fn.rs
2 // run-pass
3
4 extern crate no_mangle_associated_fn;
5
6 struct Foo;
7
8 impl Foo {
9     #[no_mangle]
10     fn foo() -> u8 {
11         1
12     }
13 }
14
15 fn main() {
16     extern "Rust" {
17         fn foo() -> u8;
18         fn bar() -> u8;
19     }
20     assert_eq!(unsafe { foo() }, 1);
21     assert_eq!(unsafe { bar() }, 2);
22 }