mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
20 lines
504 B
Rust
20 lines
504 B
Rust
//@ run-pass
|
|
// We used to have a __rust_abi shim that resulted in duplicated symbols
|
|
// whenever the item path wasn't enough to disambiguate between them.
|
|
|
|
#![allow(unpredictable_function_pointer_comparisons)]
|
|
|
|
fn main() {
|
|
let a = {
|
|
extern "C" fn good() -> i32 { return 0; }
|
|
good as extern "C" fn() -> i32
|
|
};
|
|
let b = {
|
|
extern "C" fn good() -> i32 { return 5; }
|
|
good as extern "C" fn() -> i32
|
|
};
|
|
|
|
assert!(a != b);
|
|
assert_eq!((a(), b()), (0, 5));
|
|
}
|