enable a few more tests in Miri and update the comment for others
This commit is contained in:
parent
8c6fb028ca
commit
4dd5edc76d
|
@ -761,7 +761,6 @@ fn from_into_inner() {
|
||||||
it.next().unwrap();
|
it.next().unwrap();
|
||||||
let vec = it.collect::<Vec<_>>();
|
let vec = it.collect::<Vec<_>>();
|
||||||
assert_eq!(vec, [2, 3]);
|
assert_eq!(vec, [2, 3]);
|
||||||
#[cfg(not(miri))] // Miri does not support comparing dangling pointers
|
|
||||||
assert!(ptr != vec.as_ptr());
|
assert!(ptr != vec.as_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@ mod float;
|
||||||
mod num;
|
mod num;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri cannot print pointers
|
|
||||||
fn test_format_flags() {
|
fn test_format_flags() {
|
||||||
// No residual flags left by pointer formatting
|
// No residual flags left by pointer formatting
|
||||||
let p = "".as_ptr();
|
let p = "".as_ptr();
|
||||||
|
@ -13,7 +12,6 @@ fn test_format_flags() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri cannot print pointers
|
|
||||||
fn test_pointer_formats_data_pointer() {
|
fn test_pointer_formats_data_pointer() {
|
||||||
let b: &[u8] = b"";
|
let b: &[u8] = b"";
|
||||||
let s: &str = "";
|
let s: &str = "";
|
||||||
|
|
|
@ -253,7 +253,6 @@ fn test_unsized_nonnull() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[allow(warnings)]
|
#[allow(warnings)]
|
||||||
#[cfg(not(miri))] // Miri cannot hash pointers
|
|
||||||
// Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the
|
// Have a symbol for the test below. It doesn’t need to be an actual variadic function, match the
|
||||||
// ABI, or even point to an actual executable code, because the function itself is never invoked.
|
// ABI, or even point to an actual executable code, because the function itself is never invoked.
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
@ -293,7 +292,7 @@ fn write_unaligned_drop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
|
#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
|
||||||
fn align_offset_zst() {
|
fn align_offset_zst() {
|
||||||
// For pointers of stride = 0, the pointer is already aligned or it cannot be aligned at
|
// For pointers of stride = 0, the pointer is already aligned or it cannot be aligned at
|
||||||
// all, because no amount of elements will align the pointer.
|
// all, because no amount of elements will align the pointer.
|
||||||
|
@ -308,7 +307,7 @@ fn align_offset_zst() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
|
#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
|
||||||
fn align_offset_stride1() {
|
fn align_offset_stride1() {
|
||||||
// For pointers of stride = 1, the pointer can always be aligned. The offset is equal to
|
// For pointers of stride = 1, the pointer can always be aligned. The offset is equal to
|
||||||
// number of bytes.
|
// number of bytes.
|
||||||
|
|
|
@ -1396,7 +1396,7 @@ pub mod memchr {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
|
#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
|
||||||
fn test_align_to_simple() {
|
fn test_align_to_simple() {
|
||||||
let bytes = [1u8, 2, 3, 4, 5, 6, 7];
|
let bytes = [1u8, 2, 3, 4, 5, 6, 7];
|
||||||
let (prefix, aligned, suffix) = unsafe { bytes.align_to::<u16>() };
|
let (prefix, aligned, suffix) = unsafe { bytes.align_to::<u16>() };
|
||||||
|
@ -1420,7 +1420,7 @@ fn test_align_to_zst() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg(not(miri))] // Miri cannot compute actual alignment of an allocation
|
#[cfg(not(miri))] // Miri does not compute a maximal `mid` for `align_offset`
|
||||||
fn test_align_to_non_trivial() {
|
fn test_align_to_non_trivial() {
|
||||||
#[repr(align(8))] struct U64(u64, u64);
|
#[repr(align(8))] struct U64(u64, u64);
|
||||||
#[repr(align(8))] struct U64U64U32(u64, u64, u32);
|
#[repr(align(8))] struct U64U64U32(u64, u64, u32);
|
||||||
|
|
Loading…
Reference in New Issue