ignore some vtable/fn ptr equality tests in Miri, their result is not fully predictable
This commit is contained in:
parent
9a233bb9dd
commit
4763d12207
@ -4,7 +4,7 @@ use alloc::task::{LocalWake, Wake};
|
||||
use core::task::{LocalWaker, Waker};
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(miri, should_panic)] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it fails
|
||||
#[cfg_attr(miri, ignore)] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it can fail
|
||||
fn test_waker_will_wake_clone() {
|
||||
struct NoopWaker;
|
||||
|
||||
@ -20,7 +20,7 @@ fn test_waker_will_wake_clone() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg_attr(miri, should_panic)] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it fails
|
||||
#[cfg_attr(miri, ignore)] // `will_wake` doesn't guarantee that this test will work, and indeed on Miri it can fail
|
||||
fn test_local_waker_will_wake_clone() {
|
||||
struct NoopWaker;
|
||||
|
||||
|
@ -810,9 +810,12 @@ fn ptr_metadata() {
|
||||
assert_ne!(address_1, address_2);
|
||||
// Different erased type => different vtable pointer
|
||||
assert_ne!(address_2, address_3);
|
||||
// Same erased type and same trait => same vtable pointer
|
||||
assert_eq!(address_3, address_4);
|
||||
assert_eq!(address_3, address_5);
|
||||
// Same erased type and same trait => same vtable pointer.
|
||||
// This is *not guaranteed*, so we skip it in Miri.
|
||||
if !cfg!(miri) {
|
||||
assert_eq!(address_3, address_4);
|
||||
assert_eq!(address_3, address_5);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user