You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| ^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
6
-
|
7
-
= 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.
8
-
= note: the raw bytes of the constant (size: 1, align: 1) {
9
-
03 │ .
10
-
}
5
+
| ^^^^^^^^^^^^^^^^^^^ evaluation of `FOO` failed here
| ^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
6
-
|
7
-
= 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.
8
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
9
-
HEX_DUMP
10
-
}
5
+
| ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM` failed here
11
6
12
-
error[E0080]: unable to turn pointer into integer
13
-
--> $DIR/ub-enum.rs:32:1
7
+
error[E0080]: constructing invalid value at .<enum-tag>: encountered a pointer, but expected an integer
| ^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
35
-
|
36
-
= 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.
37
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
38
-
HEX_DUMP
39
-
}
29
+
| ^^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_ENUM2` failed here
40
30
41
-
error[E0080]: unable to turn pointer into integer
42
-
--> $DIR/ub-enum.rs:49:1
31
+
error[E0080]: constructing invalid value at .<enum-tag>: encountered a pointer, but expected an integer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
79
-
|
80
-
= 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.
81
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
82
-
HEX_DUMP
83
-
}
68
+
| ^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_UNINHABITED_VARIANT1` failed here
84
69
85
70
error[E0080]: constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
90
-
|
91
-
= 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.
92
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
93
-
HEX_DUMP
94
-
}
74
+
| ^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_UNINHABITED_VARIANT2` failed here
95
75
96
-
error[E0080]: constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
97
-
--> $DIR/ub-enum.rs:92:1
76
+
error[E0080]: constructing invalid value: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
101
-
|
102
-
= 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.
103
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
104
-
HEX_DUMP
105
-
}
80
+
| ^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_OPTION_CHAR` failed here
106
81
107
82
error[E0080]: constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
Copy file name to clipboardExpand all lines: tests/ui/consts/const-eval/ub-incorrect-vtable.32bit.stderr
+20-45Lines changed: 20 additions & 45 deletions
Original file line number
Diff line number
Diff line change
@@ -1,57 +1,32 @@
1
-
error[E0080]: constructing invalid value: encountered ALLOC1<imm>, but expected a vtable pointer
2
-
--> $DIR/ub-incorrect-vtable.rs:18:1
1
+
error[E0080]: constructing invalid value: encountered ALLOC2<imm>, but expected a vtable pointer
2
+
--> $DIR/ub-incorrect-vtable.rs:19:14
3
3
|
4
-
LL | const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
5
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
6
-
|
7
-
= 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.
8
-
= note: the raw bytes of the constant (size: 8, align: 4) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INVALID_VTABLE_ALIGNMENT` failed here
11
6
12
7
error[E0080]: constructing invalid value: encountered ALLOC3<imm>, but expected a vtable pointer
13
-
--> $DIR/ub-incorrect-vtable.rs:22:1
14
-
|
15
-
LL | const INVALID_VTABLE_SIZE: &dyn Trait =
16
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
8
+
--> $DIR/ub-incorrect-vtable.rs:23:14
17
9
|
18
-
= 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.
19
-
= note: the raw bytes of the constant (size: 8, align: 4) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
28
-
|
29
-
= 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.
30
-
= note: the raw bytes of the constant (size: 8, align: 4) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
19
+
error[E0080]: constructing invalid value at .0: encountered ALLOC5<imm>, but expected a vtable pointer
20
+
--> $DIR/ub-incorrect-vtable.rs:36:14
39
21
|
40
-
= 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.
41
-
= note: the raw bytes of the constant (size: 8, align: 4) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ evaluation of `INVALID_VTABLE_SIZE_UB` failed here
44
24
45
-
error[E0080]: constructing invalid value at .0: encountered ALLOC9<imm>, but expected a vtable pointer
46
-
--> $DIR/ub-incorrect-vtable.rs:40:1
47
-
|
48
-
LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
49
-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
25
+
error[E0080]: constructing invalid value at .0: encountered ALLOC6<imm>, but expected a vtable pointer
26
+
--> $DIR/ub-incorrect-vtable.rs:41:14
50
27
|
51
-
= 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.
52
-
= note: the raw bytes of the constant (size: 8, align: 4) {
= 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.
63
38
= note: the raw bytes of the constant (size: 8, align: 4) {
0 commit comments