fmt, tweak messages and bless

This commit is contained in:
Ralf Jung 2020-03-08 19:44:09 +01:00
parent f5efb68a24
commit d02543a453
14 changed files with 88 additions and 70 deletions

View file

@ -12,7 +12,7 @@ error: any use of this value will cause an error
LL | const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
|
= note: `#[deny(const_err)]` on by default
@ -22,7 +22,7 @@ error: any use of this value will cause an error
LL | const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:34:45
@ -30,7 +30,7 @@ error: any use of this value will cause an error
LL | const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:37:5
@ -54,7 +54,7 @@ error: any use of this value will cause an error
LL | const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:46:45
@ -62,7 +62,7 @@ error: any use of this value will cause an error
LL | const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:49:45
@ -70,7 +70,7 @@ error: any use of this value will cause an error
LL | const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:52:5
@ -94,7 +94,7 @@ error: any use of this value will cause an error
LL | const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
| ----------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:61:5
@ -110,7 +110,7 @@ error: any use of this value will cause an error
LL | const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
| ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:67:47
@ -118,7 +118,7 @@ error: any use of this value will cause an error
LL | const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
| ------------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:70:39
@ -126,7 +126,7 @@ error: any use of this value will cause an error
LL | const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
| ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:73:41
@ -134,7 +134,7 @@ error: any use of this value will cause an error
LL | const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:76:41
@ -142,7 +142,7 @@ error: any use of this value will cause an error
LL | const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:79:5
@ -158,7 +158,7 @@ error: any use of this value will cause an error
LL | const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:85:39
@ -166,7 +166,7 @@ error: any use of this value will cause an error
LL | const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
| ----------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:88:41
@ -174,7 +174,7 @@ error: any use of this value will cause an error
LL | const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:91:41
@ -182,7 +182,7 @@ error: any use of this value will cause an error
LL | const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:94:5
@ -198,7 +198,7 @@ error: any use of this value will cause an error
LL | const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:100:41
@ -206,7 +206,7 @@ error: any use of this value will cause an error
LL | const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
| ------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error[E0080]: it is undefined behavior to use this value
--> $DIR/const-pointer-values-in-various-types.rs:103:5
@ -222,7 +222,7 @@ error: any use of this value will cause an error
LL | const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: any use of this value will cause an error
--> $DIR/const-pointer-values-in-various-types.rs:109:43
@ -230,7 +230,7 @@ error: any use of this value will cause an error
LL | const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
| --------------------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
| |
| a raw memory access tried to access part of a pointer value as raw bytes
| unable to turn this pointer into raw bytes
error: aborting due to 29 previous errors

View file

@ -30,7 +30,7 @@ error: any use of this value will cause an error
LL | const Z2: i32 = unsafe { *(42 as *const i32) };
| -------------------------^^^^^^^^^^^^^^^^^^^---
| |
| a memory access tried to interpret some bytes as a pointer
| unable to turn these bytes into a pointer
error: any use of this value will cause an error
--> $DIR/const_raw_ptr_ops.rs:17:26
@ -38,7 +38,7 @@ error: any use of this value will cause an error
LL | const Z3: i32 = unsafe { *(44 as *const i32) };
| -------------------------^^^^^^^^^^^^^^^^^^^---
| |
| a memory access tried to interpret some bytes as a pointer
| unable to turn these bytes into a pointer
error: aborting due to 5 previous errors

View file

@ -4,7 +4,7 @@ error: any use of this value will cause an error
LL | const X: u64 = *wat(42);
| ---------------^^^^^^^^-
| |
| dangling pointer was dereferenced
| pointer to alloc2 was dereferenced after this allocation got freed
|
= note: `#[deny(const_err)]` on by default

View file

@ -13,7 +13,7 @@ LL | / const OUT_OF_BOUNDS_PTR: NonNull<u8> = { unsafe {
LL | | let ptr: &[u8; 256] = mem::transmute(&0u8); // &0 gets promoted so it does not dangle
LL | | // Use address-of-element for pointer arithmetic. This could wrap around to NULL!
LL | | let out_of_bounds_ptr = &ptr[255];
| | ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of allocation 8 which has size 1
| | ^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset 256, but is outside bounds of alloc8 which has size 1
LL | | mem::transmute(out_of_bounds_ptr)
LL | | } };
| |____-

View file

@ -6,7 +6,7 @@
use std::mem;
// normalize-stderr-test "offset \d+" -> "offset N"
// normalize-stderr-test "allocation \d+" -> "allocation N"
// normalize-stderr-test "alloc\d+" -> "allocN"
// normalize-stderr-test "size \d+" -> "size N"
#[repr(C)]

View file

@ -192,7 +192,7 @@ error[E0080]: could not evaluate static initializer
--> $DIR/ub-wide-ptr.rs:125:5
|
LL | mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset N, but is outside bounds of allocation N which has size N
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Memory access failed: pointer must be in-bounds at offset N, but is outside bounds of allocN which has size N
error: aborting due to 24 previous errors

View file

@ -5,7 +5,7 @@ LL | / const FOO: &() = {
LL | | let y = ();
LL | | unsafe { Foo { y: &y }.long_live_the_unit }
LL | | };
| |__^ type validation failed: encountered dangling pointer in final constant
| |__^ encountered dangling pointer in final constant
|
= note: `#[deny(const_err)]` on by default

View file

@ -5,7 +5,7 @@ LL | / const FOO: *const u32 = {
LL | | let x = 42;
LL | | &x
LL | | };
| |__^ type validation failed: encountered dangling pointer in final constant
| |__^ encountered dangling pointer in final constant
|
= note: `#[deny(const_err)]` on by default

View file

@ -16,7 +16,7 @@ error: any use of this value will cause an error
LL | my_fn();
| ^^^^^^^
| |
| tried to call a function with ABI C using caller ABI Rust
| calling a function with ABI C using caller ABI Rust
| inside call to `call_rust_fn` at $DIR/abi-mismatch.rs:13:17
...
LL | const VAL: () = call_rust_fn(unsafe { std::mem::transmute(c_fn as extern "C" fn()) });

View file

@ -11,7 +11,7 @@ LL | / const MUTATING_BEHIND_RAW: () = {
LL | | // Test that `MUTABLE_BEHIND_RAW` is actually immutable, by doing this at const time.
LL | | unsafe {
LL | | *MUTABLE_BEHIND_RAW = 99
| | ^^^^^^^^^^^^^^^^^^^^^^^^ tried to modify constant memory
| | ^^^^^^^^^^^^^^^^^^^^^^^^ writing to alloc1 which is read-only
LL | | }
LL | | };
| |__-

View file

@ -26,7 +26,7 @@ error: any use of this value will cause an error
LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| a memory access tried to interpret some bytes as a pointer
| unable to turn these bytes into a pointer
| inside call to `std::ptr::const_ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:28:14
|
::: $DIR/offset_from_ub.rs:26:1
@ -81,7 +81,7 @@ error: any use of this value will cause an error
LL | intrinsics::ptr_offset_from(self, origin)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| a memory access tried to interpret some bytes as a pointer
| unable to turn these bytes into a pointer
| inside call to `std::ptr::const_ptr::<impl *const u8>::offset_from` at $DIR/offset_from_ub.rs:49:14
|
::: $DIR/offset_from_ub.rs:45:1