diff --git a/rust-version b/rust-version index 323af716826..1ab8e6b5a8c 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -ddcbba036aee08f0709f98a92a342a278eae5c05 +bf45371f262e184b4a77adea88c8ac01ac79759b diff --git a/tests/fail/branchless-select-i128-pointer.rs b/tests/fail/branchless-select-i128-pointer.rs index 7e1b969e02c..a3b4021ba0c 100644 --- a/tests/fail/branchless-select-i128-pointer.rs +++ b/tests/fail/branchless-select-i128-pointer.rs @@ -12,7 +12,7 @@ fn main() { // However, it drops provenance when transmuting to TwoPtrs, so this is UB. let val = unsafe { transmute::<_, &str>( - //~^ ERROR type validation failed: encountered a dangling reference + //~^ ERROR constructing invalid value: encountered a dangling reference !mask & transmute::<_, TwoPtrs>("false !") | mask & transmute::<_, TwoPtrs>("true !"), ) diff --git a/tests/fail/branchless-select-i128-pointer.stderr b/tests/fail/branchless-select-i128-pointer.stderr index 374d6ab0680..5cb05f33dde 100644 --- a/tests/fail/branchless-select-i128-pointer.stderr +++ b/tests/fail/branchless-select-i128-pointer.stderr @@ -1,4 +1,4 @@ -error: Undefined Behavior: type validation failed: encountered a dangling reference (address $HEX is unallocated) +error: Undefined Behavior: constructing invalid value: encountered a dangling reference (address $HEX is unallocated) --> $DIR/branchless-select-i128-pointer.rs:LL:CC | LL | / transmute::<_, &str>( @@ -6,7 +6,7 @@ LL | | LL | | !mask & transmute::<_, TwoPtrs>("false !") LL | | | mask & transmute::<_, TwoPtrs>("true !"), LL | | ) - | |_____________^ type validation failed: encountered a dangling reference (address $HEX is unallocated) + | |_____________^ constructing invalid value: encountered a dangling reference (address $HEX is unallocated) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/issue-miri-1112.stderr b/tests/fail/issue-miri-1112.stderr index 1dfcad0c147..cf692bddaf4 100644 --- a/tests/fail/issue-miri-1112.stderr +++ b/tests/fail/issue-miri-1112.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered invalid drop function pointer in vtable (function has incompatible signature) +error: Undefined Behavior: constructing invalid value: encountered invalid drop function pointer in vtable (function has incompatible signature) --> $DIR/issue-miri-1112.rs:LL:CC | LL | let obj = std::mem::transmute::(obj); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid drop function pointer in vtable (function has incompatible signature) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid drop function pointer in vtable (function has incompatible signature) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/stacked_borrows/vtable.stderr b/tests/fail/stacked_borrows/vtable.stderr index ac3d71045f0..31c3d5982e5 100644 --- a/tests/fail/stacked_borrows/vtable.stderr +++ b/tests/fail/stacked_borrows/vtable.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered vtable pointer does not have permission to read drop function pointer +error: Undefined Behavior: constructing invalid value: encountered vtable pointer does not have permission to read drop function pointer --> RUSTLIB/core/src/ptr/metadata.rs:LL:CC | LL | unsafe { PtrRepr { components: PtrComponents { data_address, metadata } }.const_ptr } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered vtable pointer does not have permission to read drop function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered vtable pointer does not have permission to read drop function pointer | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/transmute-pair-uninit.stderr b/tests/fail/transmute-pair-uninit.stderr index 833c3abbb2f..c1f90c3efb6 100644 --- a/tests/fail/transmute-pair-uninit.stderr +++ b/tests/fail/transmute-pair-uninit.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered uninitialized bytes, but expected initialized bytes +error: Undefined Behavior: constructing invalid value: encountered uninitialized bytes, but expected initialized bytes --> $DIR/transmute-pair-uninit.rs:LL:CC | LL | let v = unsafe { *z.offset(first_undef) }; - | ^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/transmute_fat1.rs b/tests/fail/transmute_fat1.rs index 79286f3e27d..a60efb98f9d 100644 --- a/tests/fail/transmute_fat1.rs +++ b/tests/fail/transmute_fat1.rs @@ -7,7 +7,7 @@ const N: usize = 8; fn main() { let bad = unsafe { std::mem::transmute::<&[u8], [u8; N]>(&[1u8]) - //~^ ERROR: type validation failed: encountered a pointer + //~^ ERROR: constructing invalid value: encountered a pointer }; let _val = bad[0] + bad[bad.len() - 1]; } diff --git a/tests/fail/transmute_fat1.stderr b/tests/fail/transmute_fat1.stderr index baf6195f92a..6263427bac5 100644 --- a/tests/fail/transmute_fat1.stderr +++ b/tests/fail/transmute_fat1.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a pointer, but expected plain (non-pointer) bytes +error: Undefined Behavior: constructing invalid value: encountered a pointer, but expected plain (non-pointer) bytes --> $DIR/transmute_fat1.rs:LL:CC | LL | std::mem::transmute::<&[u8], [u8; N]>(&[1u8]) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected plain (non-pointer) bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a pointer, but expected plain (non-pointer) bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/uninit_byte_read.stderr b/tests/fail/uninit_byte_read.stderr index d150be3e7e7..d15b10dc6ed 100644 --- a/tests/fail/uninit_byte_read.stderr +++ b/tests/fail/uninit_byte_read.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered uninitialized bytes, but expected initialized bytes +error: Undefined Behavior: constructing invalid value: encountered uninitialized bytes, but expected initialized bytes --> $DIR/uninit_byte_read.rs:LL:CC | LL | let undef = unsafe { *v.get_unchecked(5) }; - | ^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected initialized bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/uninit_raw_ptr.rs b/tests/fail/uninit_raw_ptr.rs index beb9ad12709..c2ede1bb146 100644 --- a/tests/fail/uninit_raw_ptr.rs +++ b/tests/fail/uninit_raw_ptr.rs @@ -1,4 +1,4 @@ fn main() { let _val = unsafe { std::mem::MaybeUninit::<*const u8>::uninit().assume_init() }; - //~^ ERROR type validation failed at .value: encountered uninitialized raw pointer + //~^ ERROR constructing invalid value at .value: encountered uninitialized raw pointer } diff --git a/tests/fail/uninit_raw_ptr.stderr b/tests/fail/uninit_raw_ptr.stderr index 96074fc1e78..c76f59e13e7 100644 --- a/tests/fail/uninit_raw_ptr.stderr +++ b/tests/fail/uninit_raw_ptr.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed at .value: encountered uninitialized raw pointer +error: Undefined Behavior: constructing invalid value at .value: encountered uninitialized raw pointer --> $DIR/uninit_raw_ptr.rs:LL:CC | LL | let _val = unsafe { std::mem::MaybeUninit::<*const u8>::uninit().assume_init() }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .value: encountered uninitialized raw pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value: encountered uninitialized raw pointer | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/cast_fn_ptr1.stderr b/tests/fail/validity/cast_fn_ptr1.stderr index d048377a779..05c75ac1338 100644 --- a/tests/fail/validity/cast_fn_ptr1.stderr +++ b/tests/fail/validity/cast_fn_ptr1.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a null reference +error: Undefined Behavior: constructing invalid value: encountered a null reference --> $DIR/cast_fn_ptr1.rs:LL:CC | LL | g(0usize as *const i32) - | ^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a null reference + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/cast_fn_ptr2.stderr b/tests/fail/validity/cast_fn_ptr2.stderr index 10b9b9b8602..8bee099caf3 100644 --- a/tests/fail/validity/cast_fn_ptr2.stderr +++ b/tests/fail/validity/cast_fn_ptr2.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a null reference +error: Undefined Behavior: constructing invalid value: encountered a null reference --> $DIR/cast_fn_ptr2.rs:LL:CC | LL | let _x = g(); - | ^^^ type validation failed: encountered a null reference + | ^^^ constructing invalid value: encountered a null reference | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/dangling_ref1.stderr b/tests/fail/validity/dangling_ref1.stderr index 0d358fd7f7f..290963c6d4e 100644 --- a/tests/fail/validity/dangling_ref1.stderr +++ b/tests/fail/validity/dangling_ref1.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a dangling reference (address 0x10 is unallocated) +error: Undefined Behavior: constructing invalid value: encountered a dangling reference (address 0x10 is unallocated) --> $DIR/dangling_ref1.rs:LL:CC | LL | let _x: &i32 = unsafe { mem::transmute(16usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (address 0x10 is unallocated) + | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (address 0x10 is unallocated) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/dangling_ref2.stderr b/tests/fail/validity/dangling_ref2.stderr index e3bbb72fdcf..ce60f973ffe 100644 --- a/tests/fail/validity/dangling_ref2.stderr +++ b/tests/fail/validity/dangling_ref2.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a dangling reference (going beyond the bounds of its allocation) +error: Undefined Behavior: constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) --> $DIR/dangling_ref2.rs:LL:CC | LL | let _x: &i32 = unsafe { mem::transmute(ptr) }; - | ^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (going beyond the bounds of its allocation) + | ^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/dangling_ref3.stderr b/tests/fail/validity/dangling_ref3.stderr index 5842eca9fc8..aa25f165608 100644 --- a/tests/fail/validity/dangling_ref3.stderr +++ b/tests/fail/validity/dangling_ref3.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a dangling reference (use-after-free) +error: Undefined Behavior: constructing invalid value: encountered a dangling reference (use-after-free) --> $DIR/dangling_ref3.rs:LL:CC | LL | let _x: &i32 = unsafe { mem::transmute(dangling()) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (use-after-free) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (use-after-free) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_bool.stderr b/tests/fail/validity/invalid_bool.stderr index d17319d2dce..756c094d6e8 100644 --- a/tests/fail/validity/invalid_bool.stderr +++ b/tests/fail/validity/invalid_bool.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered 0x02, but expected a boolean +error: Undefined Behavior: constructing invalid value: encountered 0x02, but expected a boolean --> $DIR/invalid_bool.rs:LL:CC | LL | let _b = unsafe { std::mem::transmute::(2) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x02, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x02, but expected a boolean | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_bool_uninit.stderr b/tests/fail/validity/invalid_bool_uninit.stderr index e262e69dc69..5236cab450b 100644 --- a/tests/fail/validity/invalid_bool_uninit.stderr +++ b/tests/fail/validity/invalid_bool_uninit.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered uninitialized bytes, but expected a boolean +error: Undefined Behavior: constructing invalid value: encountered uninitialized bytes, but expected a boolean --> $DIR/invalid_bool_uninit.rs:LL:CC | LL | let _b = unsafe { MyUninit { init: () }.uninit }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a boolean + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a boolean | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_char.stderr b/tests/fail/validity/invalid_char.stderr index 99f5ce0bb21..538af4aefca 100644 --- a/tests/fail/validity/invalid_char.stderr +++ b/tests/fail/validity/invalid_char.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) +error: Undefined Behavior: constructing invalid value: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) --> $DIR/invalid_char.rs:LL:CC | LL | let _val = match unsafe { std::mem::transmute::(-1) } { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered $HEX, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_char_uninit.stderr b/tests/fail/validity/invalid_char_uninit.stderr index b27c9b2bb69..12bc0faa513 100644 --- a/tests/fail/validity/invalid_char_uninit.stderr +++ b/tests/fail/validity/invalid_char_uninit.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) +error: Undefined Behavior: constructing invalid value: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) --> $DIR/invalid_char_uninit.rs:LL:CC | LL | let _b = unsafe { MyUninit { init: () }.uninit }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=$HEX` but not in `$HEX..=$HEX`) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_enum_tag.rs b/tests/fail/validity/invalid_enum_tag.rs index 9722e6492c8..4bc60ba51e7 100644 --- a/tests/fail/validity/invalid_enum_tag.rs +++ b/tests/fail/validity/invalid_enum_tag.rs @@ -7,5 +7,5 @@ pub enum Foo { } fn main() { - let _f = unsafe { std::mem::transmute::(42) }; //~ ERROR type validation failed at .: encountered 0x0000002a, but expected a valid enum tag + let _f = unsafe { std::mem::transmute::(42) }; //~ ERROR constructing invalid value at .: encountered 0x0000002a, but expected a valid enum tag } diff --git a/tests/fail/validity/invalid_enum_tag.stderr b/tests/fail/validity/invalid_enum_tag.stderr index c6d862ae1b0..c7014ae71ac 100644 --- a/tests/fail/validity/invalid_enum_tag.stderr +++ b/tests/fail/validity/invalid_enum_tag.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed at .: encountered $HEX, but expected a valid enum tag +error: Undefined Behavior: constructing invalid value at .: encountered $HEX, but expected a valid enum tag --> $DIR/invalid_enum_tag.rs:LL:CC | -LL | ... { std::mem::transmute::(42) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .: encountered $HEX, but expected a valid enum tag +LL | let _f = unsafe { std::mem::transmute::(42) }; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered $HEX, but expected a valid enum tag | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs b/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs index b6f86698b3f..7573a64d0eb 100644 --- a/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs +++ b/tests/fail/validity/invalid_enum_tag_256variants_uninit.rs @@ -268,5 +268,5 @@ union MyUninit { } fn main() { - let _a = unsafe { MyUninit { init: () }.uninit }; //~ ERROR type validation failed at .: encountered uninitialized bytes, but expected a valid enum tag + let _a = unsafe { MyUninit { init: () }.uninit }; //~ ERROR constructing invalid value at .: encountered uninitialized bytes, but expected a valid enum tag } diff --git a/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr b/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr index 0e924bb741a..c9fd312a96c 100644 --- a/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr +++ b/tests/fail/validity/invalid_enum_tag_256variants_uninit.stderr @@ -1,9 +1,9 @@ WARNING: `-Zmiri-allow-uninit-numbers` is deprecated and planned to be removed. Please let us know at if you rely on this flag. -error: Undefined Behavior: type validation failed at .: encountered uninitialized bytes, but expected a valid enum tag +error: Undefined Behavior: constructing invalid value at .: encountered uninitialized bytes, but expected a valid enum tag --> $DIR/invalid_enum_tag_256variants_uninit.rs:LL:CC | LL | let _a = unsafe { MyUninit { init: () }.uninit }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .: encountered uninitialized bytes, but expected a valid enum tag + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .: encountered uninitialized bytes, but expected a valid enum tag | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_fnptr_null.stderr b/tests/fail/validity/invalid_fnptr_null.stderr index e3cea40e0c3..13e8957e615 100644 --- a/tests/fail/validity/invalid_fnptr_null.stderr +++ b/tests/fail/validity/invalid_fnptr_null.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a null function pointer +error: Undefined Behavior: constructing invalid value: encountered a null function pointer --> $DIR/invalid_fnptr_null.rs:LL:CC | LL | let _b: fn() = unsafe { std::mem::transmute(0usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a null function pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null function pointer | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_fnptr_uninit.stderr b/tests/fail/validity/invalid_fnptr_uninit.stderr index 84a5657e787..b64655fa818 100644 --- a/tests/fail/validity/invalid_fnptr_uninit.stderr +++ b/tests/fail/validity/invalid_fnptr_uninit.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered uninitialized bytes, but expected a proper pointer or integer value +error: Undefined Behavior: constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value --> $DIR/invalid_fnptr_uninit.rs:LL:CC | LL | let _b = unsafe { MyUninit { init: () }.uninit }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a proper pointer or integer value + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered uninitialized bytes, but expected a proper pointer or integer value | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/invalid_wide_raw.stderr b/tests/fail/validity/invalid_wide_raw.stderr index f64b824d6ba..633f8f8adbc 100644 --- a/tests/fail/validity/invalid_wide_raw.stderr +++ b/tests/fail/validity/invalid_wide_raw.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered dangling vtable pointer in wide pointer +error: Undefined Behavior: constructing invalid value: encountered dangling vtable pointer in wide pointer --> $DIR/invalid_wide_raw.rs:LL:CC | LL | dbg!(S { x: unsafe { std::mem::transmute((0usize, 0usize)) } }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered dangling vtable pointer in wide pointer + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered dangling vtable pointer in wide pointer | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/nonzero.stderr b/tests/fail/validity/nonzero.stderr index ba01acb6a16..0c6a2417230 100644 --- a/tests/fail/validity/nonzero.stderr +++ b/tests/fail/validity/nonzero.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered 0, but expected something greater or equal to 1 +error: Undefined Behavior: constructing invalid value: encountered 0, but expected something greater or equal to 1 --> $DIR/nonzero.rs:LL:CC | LL | let _x = Some(unsafe { NonZero(0) }); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0, but expected something greater or equal to 1 + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1 | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/ptr_integer_array_transmute.stderr b/tests/fail/validity/ptr_integer_array_transmute.stderr index bc2ca54438f..39b4ebfc8f1 100644 --- a/tests/fail/validity/ptr_integer_array_transmute.stderr +++ b/tests/fail/validity/ptr_integer_array_transmute.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a pointer, but expected plain (non-pointer) bytes +error: Undefined Behavior: constructing invalid value: encountered a pointer, but expected plain (non-pointer) bytes --> $DIR/ptr_integer_array_transmute.rs:LL:CC | LL | let _i: [usize; 1] = unsafe { std::mem::transmute(r) }; - | ^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer, but expected plain (non-pointer) bytes + | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a pointer, but expected plain (non-pointer) bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/ref_to_uninhabited1.stderr b/tests/fail/validity/ref_to_uninhabited1.stderr index dbaee46a93b..526b6a4dc25 100644 --- a/tests/fail/validity/ref_to_uninhabited1.stderr +++ b/tests/fail/validity/ref_to_uninhabited1.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a box pointing to uninhabited type ! +error: Undefined Behavior: constructing invalid value: encountered a box pointing to uninhabited type ! --> $DIR/ref_to_uninhabited1.rs:LL:CC | LL | let x: Box = transmute(&mut 42); - | ^^^^^^^^^^^^^^^^^^ type validation failed: encountered a box pointing to uninhabited type ! + | ^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a box pointing to uninhabited type ! | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/ref_to_uninhabited2.stderr b/tests/fail/validity/ref_to_uninhabited2.stderr index 115cdfedf77..297b0540ab0 100644 --- a/tests/fail/validity/ref_to_uninhabited2.stderr +++ b/tests/fail/validity/ref_to_uninhabited2.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered a reference pointing to uninhabited type (i32, Void) +error: Undefined Behavior: constructing invalid value: encountered a reference pointing to uninhabited type (i32, Void) --> $DIR/ref_to_uninhabited2.rs:LL:CC | LL | let _x: &(i32, Void) = transmute(&42); - | ^^^^^^^^^^^^^^ type validation failed: encountered a reference pointing to uninhabited type (i32, Void) + | ^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type (i32, Void) | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/too-big-slice.stderr b/tests/fail/validity/too-big-slice.stderr index 9c8d2929bda..52077f16a1c 100644 --- a/tests/fail/validity/too-big-slice.stderr +++ b/tests/fail/validity/too-big-slice.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered invalid reference metadata: slice is bigger than largest supported object +error: Undefined Behavior: constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object --> $DIR/too-big-slice.rs:LL:CC | LL | let _x: &[u8] = mem::transmute((ptr, usize::MAX)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid reference metadata: slice is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/too-big-unsized.stderr b/tests/fail/validity/too-big-unsized.stderr index 18dc5d8b9c1..a20f1de6d57 100644 --- a/tests/fail/validity/too-big-unsized.stderr +++ b/tests/fail/validity/too-big-unsized.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed: encountered invalid reference metadata: total size is bigger than largest supported object +error: Undefined Behavior: constructing invalid value: encountered invalid reference metadata: total size is bigger than largest supported object --> $DIR/too-big-unsized.rs:LL:CC | LL | let _x: &MySlice = mem::transmute((ptr, isize::MAX as usize)); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered invalid reference metadata: total size is bigger than largest supported object + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: total size is bigger than largest supported object | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/transmute_through_ptr.rs b/tests/fail/validity/transmute_through_ptr.rs index 049c57e6193..9db2ba99530 100644 --- a/tests/fail/validity/transmute_through_ptr.rs +++ b/tests/fail/validity/transmute_through_ptr.rs @@ -14,6 +14,6 @@ fn main() { let mut x = Bool::True; evil(&mut x); let y = x; // reading this ought to be enough to trigger validation - //~^ ERROR type validation failed at .: encountered 0x0000002c, but expected a valid enum tag + //~^ ERROR constructing invalid value at .: encountered 0x0000002c, but expected a valid enum tag println!("{:?}", y); // make sure it is used (and not optimized away) } diff --git a/tests/fail/validity/transmute_through_ptr.stderr b/tests/fail/validity/transmute_through_ptr.stderr index d06dbe3194f..50f699d7f9b 100644 --- a/tests/fail/validity/transmute_through_ptr.stderr +++ b/tests/fail/validity/transmute_through_ptr.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed at .: encountered $HEX, but expected a valid enum tag +error: Undefined Behavior: constructing invalid value at .: encountered $HEX, but expected a valid enum tag --> $DIR/transmute_through_ptr.rs:LL:CC | LL | let y = x; // reading this ought to be enough to trigger validation - | ^ type validation failed at .: encountered $HEX, but expected a valid enum tag + | ^ constructing invalid value at .: encountered $HEX, but expected a valid enum tag | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/uninit_float.rs b/tests/fail/validity/uninit_float.rs index e79cbb45f98..43748570d9a 100644 --- a/tests/fail/validity/uninit_float.rs +++ b/tests/fail/validity/uninit_float.rs @@ -2,5 +2,5 @@ fn main() { let _val = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; - //~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes + //~^ ERROR constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes } diff --git a/tests/fail/validity/uninit_float.stderr b/tests/fail/validity/uninit_float.stderr index 3f244adbabe..946897bd4ea 100644 --- a/tests/fail/validity/uninit_float.stderr +++ b/tests/fail/validity/uninit_float.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes +error: Undefined Behavior: constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes --> $DIR/uninit_float.rs:LL:CC | LL | let _val = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/uninit_integer.rs b/tests/fail/validity/uninit_integer.rs index bfa25d6ef35..b5a367ba8cb 100644 --- a/tests/fail/validity/uninit_integer.rs +++ b/tests/fail/validity/uninit_integer.rs @@ -2,5 +2,5 @@ fn main() { let _val = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; - //~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes + //~^ ERROR constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes } diff --git a/tests/fail/validity/uninit_integer.stderr b/tests/fail/validity/uninit_integer.stderr index e3e2f0a1785..7e9d38a4b7b 100644 --- a/tests/fail/validity/uninit_integer.stderr +++ b/tests/fail/validity/uninit_integer.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes +error: Undefined Behavior: constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes --> $DIR/uninit_integer.rs:LL:CC | LL | let _val = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information diff --git a/tests/fail/validity/uninit_integer_signed.rs b/tests/fail/validity/uninit_integer_signed.rs index 1764120805c..609bad7e4fb 100644 --- a/tests/fail/validity/uninit_integer_signed.rs +++ b/tests/fail/validity/uninit_integer_signed.rs @@ -2,5 +2,5 @@ fn main() { let _val = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; - //~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes + //~^ ERROR constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes } diff --git a/tests/fail/validity/uninit_integer_signed.stderr b/tests/fail/validity/uninit_integer_signed.stderr index e6d9b51e40e..bd8ea42c3a4 100644 --- a/tests/fail/validity/uninit_integer_signed.stderr +++ b/tests/fail/validity/uninit_integer_signed.stderr @@ -1,8 +1,8 @@ -error: Undefined Behavior: type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes +error: Undefined Behavior: constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes --> $DIR/uninit_integer_signed.rs:LL:CC | LL | let _val = unsafe { std::mem::MaybeUninit::::uninit().assume_init() }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .value: encountered uninitialized bytes, but expected initialized bytes | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information