We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9560da0 commit ea2ecd4Copy full SHA for ea2ecd4
tests/pass/function_pointers.rs
@@ -80,9 +80,8 @@ fn main() {
80
// but Miri currently uses a fixed address for monomorphic functions.
81
assert!(return_fn_ptr(i) == i);
82
assert!(return_fn_ptr(i) as unsafe fn() -> i32 == i as fn() -> i32 as unsafe fn() -> i32);
83
- // We don't check anything for `f`. Miri gives it many different addresses
84
- // but mir-opts can turn them into the same address.
85
- let _val = return_fn_ptr(f) != f;
+ // Miri gives it many different addresses to different reifications of a generic function.
+ assert!(return_fn_ptr(f) != f);
86
// However, if we only turn `f` into a function pointer and use that pointer,
87
// it is equal to itself.
88
let f2 = f as fn() -> i32;
0 commit comments