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:33: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:50: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
83
-
|
84
-
= 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.
85
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
86
-
HEX_DUMP
87
-
}
72
+
| ^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_UNINHABITED_VARIANT1` failed here
88
73
89
74
error[E0080]: constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
94
-
|
95
-
= 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.
96
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
97
-
HEX_DUMP
98
-
}
78
+
| ^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_UNINHABITED_VARIANT2` failed here
99
79
100
-
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`)
101
-
--> $DIR/ub-enum.rs:93:1
80
+
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
105
-
|
106
-
= 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.
107
-
= note: the raw bytes of the constant (size: $SIZE, align: $ALIGN) {
108
-
HEX_DUMP
109
-
}
84
+
| ^^^^^^^^^^^^^^^^^^^^^ evaluation of `BAD_OPTION_CHAR` failed here
110
85
111
86
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
+13-18Lines changed: 13 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -1,43 +1,38 @@
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
8
+
--> $DIR/ub-incorrect-vtable.rs:23:14
14
9
|
15
10
LL | const INVALID_VTABLE_SIZE: &dyn Trait =
16
11
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
17
12
|
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.
13
+
= 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
14
= note: the raw bytes of the constant (size: 8, align: 4) {
20
15
╾ALLOC2<imm>╼ ╾ALLOC3<imm>╼ │ ╾──╼╾──╼
21
16
}
22
17
23
18
error[E0080]: constructing invalid value at .0: encountered ALLOC5<imm>, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
28
23
|
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.
24
+
= 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
25
= note: the raw bytes of the constant (size: 8, align: 4) {
31
26
╾ALLOC4<imm>╼ ╾ALLOC5<imm>╼ │ ╾──╼╾──╼
32
27
}
33
28
34
-
error[E0080]: constructing invalid value at .0: encountered ALLOC7<imm>, but expected a vtable pointer
35
-
--> $DIR/ub-incorrect-vtable.rs:35:1
29
+
error[E0080]: constructing invalid value at .0: encountered ALLOC6<imm>, but expected a vtable pointer
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
39
34
|
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.
35
+
= 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
36
= note: the raw bytes of the constant (size: 8, align: 4) {
42
37
╾ALLOC6<imm>╼ ╾ALLOC7<imm>╼ │ ╾──╼╾──╼
43
38
}
@@ -48,7 +43,7 @@ error[E0080]: constructing invalid value at .0: encountered ALLOC9<imm>, but exp
48
43
LL | const INVALID_VTABLE_UB: W<&dyn Trait> =
49
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ it is undefined behavior to use this value
50
45
|
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.
46
+
= 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
47
= 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
58
= note: the raw bytes of the constant (size: 8, align: 4) {
0 commit comments