diff options
| author | Ralf Jung <post@ralfj.de> | 2024-07-02 21:05:22 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-07-02 21:05:30 +0200 |
| commit | 41b98da42d0500e38b9dd85c82110ba177ac4de1 (patch) | |
| tree | 715c5787c45f093f51c827775a67240ff8f82727 /src/tools/miri/tests/pass/function_pointers.rs | |
| parent | 7d97c59438e933e86f557ed999da3b8dfc6855a7 (diff) | |
| download | rust-41b98da42d0500e38b9dd85c82110ba177ac4de1.tar.gz rust-41b98da42d0500e38b9dd85c82110ba177ac4de1.zip | |
Miri function identity hack: account for possible inlining
Diffstat (limited to 'src/tools/miri/tests/pass/function_pointers.rs')
| -rw-r--r-- | src/tools/miri/tests/pass/function_pointers.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/miri/tests/pass/function_pointers.rs b/src/tools/miri/tests/pass/function_pointers.rs index 36679b7180a..2aa3ebf2dd0 100644 --- a/src/tools/miri/tests/pass/function_pointers.rs +++ b/src/tools/miri/tests/pass/function_pointers.rs @@ -23,6 +23,7 @@ fn h(i: i32, j: i32) -> i32 { j * i * 7 } +#[inline(never)] fn i() -> i32 { 73 } @@ -77,7 +78,7 @@ fn main() { assert_eq!(indirect_mut3(h), 210); assert_eq!(indirect_once3(h), 210); // Check that `i` always has the same address. This is not guaranteed - // but Miri currently uses a fixed address for monomorphic functions. + // but Miri currently uses a fixed address for non-inlineable monomorphic functions. assert!(return_fn_ptr(i) == i); assert!(return_fn_ptr(i) as unsafe fn() -> i32 == i as fn() -> i32 as unsafe fn() -> i32); // Miri gives different addresses to different reifications of a generic function. |
