]> git.lizzy.rs Git - rust.git/blob - src/test/ui/unique/unique-ffi-symbols.rs
Rollup merge of #88624 - kellerkindt:master, r=JohnTitor
[rust.git] / src / test / ui / unique / unique-ffi-symbols.rs
1 // run-pass
2 // We used to have a __rust_abi shim that resulted in duplicated symbols
3 // whenever the item path wasn't enough to disambiguate between them.
4 fn main() {
5     let a = {
6         extern "C" fn good() -> i32 { return 0; }
7         good as extern "C" fn() -> i32
8     };
9     let b = {
10         extern "C" fn good() -> i32 { return 5; }
11         good as extern "C" fn() -> i32
12     };
13
14     assert!(a != b);
15     assert_eq!((a(), b()), (0, 5));
16 }