about summary refs log tree commit diff
path: root/src/test/ui/const-generics
diff options
context:
space:
mode:
authorHameer Abbasi <einstein.edison@gmail.com>2021-02-01 12:02:31 +0000
committerHameer Abbasi <einstein.edison@gmail.com>2021-03-31 07:21:08 +0000
commitc3ec0add8b65e50b6c549353823c7652c354ea2b (patch)
tree5b8240fbdb03410200182da15bc637c43b367ced /src/test/ui/const-generics
parent6ff482bde5d22a3a0171edb3245327f43cf9b593 (diff)
downloadrust-c3ec0add8b65e50b6c549353823c7652c354ea2b.tar.gz
rust-c3ec0add8b65e50b6c549353823c7652c354ea2b.zip
Add allocation information to undefined behaviour errors.
Diffstat (limited to 'src/test/ui/const-generics')
-rw-r--r--src/test/ui/const-generics/min_const_generics/invalid-patterns.stderr12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/min_const_generics/invalid-patterns.stderr b/src/test/ui/const-generics/min_const_generics/invalid-patterns.stderr
index 04f716fa733..38c126319b2 100644
--- a/src/test/ui/const-generics/min_const_generics/invalid-patterns.stderr
+++ b/src/test/ui/const-generics/min_const_generics/invalid-patterns.stderr
@@ -29,6 +29,9 @@ LL |   get_flag::<false, { unsafe { char_raw.character } }>();
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
    |
    = 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: 4, align: 4) {
+               __ __ __ __                                     │ ░░░░
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/invalid-patterns.rs:39:14
@@ -37,6 +40,9 @@ LL |   get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x42, but expected a boolean
    |
    = 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: 1, align: 1) {
+               42                                              │ B
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/invalid-patterns.rs:41:14
@@ -45,6 +51,9 @@ LL |   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x42, but expected a boolean
    |
    = 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: 1, align: 1) {
+               42                                              │ B
+           }
 
 error[E0080]: it is undefined behavior to use this value
   --> $DIR/invalid-patterns.rs:41:47
@@ -53,6 +62,9 @@ LL |   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered uninitialized bytes, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
    |
    = 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: 4, align: 4) {
+               __ __ __ __                                     │ ░░░░
+           }
 
 error: aborting due to 8 previous errors