diff options
| author | Ralf Jung <post@ralfj.de> | 2022-05-17 17:32:36 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2022-05-17 17:32:36 +0200 |
| commit | 501f5d09a0920c66d50fc898ae7649794ea26fa3 (patch) | |
| tree | d0ba72e0fa0fa2976b81974d2151cdaf64e69c7a /src/test | |
| parent | 735efc0c703812343a5e5d19b600dac73b8a89f0 (diff) | |
| download | rust-501f5d09a0920c66d50fc898ae7649794ea26fa3.tar.gz rust-501f5d09a0920c66d50fc898ae7649794ea26fa3.zip | |
interpret/validity: reject references to uninhabited types
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr | 2 | ||||
| -rw-r--r-- | src/test/ui/consts/validate_never_arrays.64bit.stderr | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr b/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr index 13a4fde0830..47349750111 100644 --- a/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr +++ b/src/test/ui/consts/const-eval/ub-uninhabit.64bit.stderr @@ -11,7 +11,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/ub-uninhabit.rs:18:1 | LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>: encountered a value of uninhabited type Bar + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a reference pointing to uninhabited type Bar | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { diff --git a/src/test/ui/consts/validate_never_arrays.64bit.stderr b/src/test/ui/consts/validate_never_arrays.64bit.stderr index c145eddef57..c5a71e5be51 100644 --- a/src/test/ui/consts/validate_never_arrays.64bit.stderr +++ b/src/test/ui/consts/validate_never_arrays.64bit.stderr @@ -2,7 +2,7 @@ error[E0080]: it is undefined behavior to use this value --> $DIR/validate_never_arrays.rs:4:1 | LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed at .<deref>[0]: encountered a value of the never type `!` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a reference pointing to uninhabited type [!; 1] | = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior. = note: the raw bytes of the constant (size: 8, align: 8) { |
