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
Rollup merge of #71164 - RalfJung:uninit-not-undef, r=oli-obk
reword Miri validity errors: undefined -> uninitialized
I don't think we say "undefined value" or anything like that anywhere in the docs or so, but we do use the term "uninitialized memory", so I think we should do the same here.
Longer-term, I think we should also internally rename "undef" to "uninit".
r? @oli-obk
error[E0080]: it is undefined behavior to use this value
2
+
--> $DIR/ub-int-array.rs:15:1
3
+
|
4
+
LL | / const UNINIT_INT_0: [u32; 3] = unsafe {
5
+
LL | |
6
+
LL | |
7
+
LL | | [
8
+
... |
9
+
LL | | ]
10
+
LL | | };
11
+
| |__^ type validation failed: encountered uninitialized bytes at [0]
12
+
|
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.
14
+
15
+
error[E0080]: it is undefined behavior to use this value
16
+
--> $DIR/ub-int-array.rs:24:1
17
+
|
18
+
LL | / const UNINIT_INT_1: [u32; 3] = unsafe {
19
+
LL | |
20
+
LL | |
21
+
LL | | mem::transmute(
22
+
... |
23
+
LL | | )
24
+
LL | | };
25
+
| |__^ type validation failed: encountered uninitialized bytes at [1]
26
+
|
27
+
= 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.
28
+
29
+
error[E0080]: it is undefined behavior to use this value
30
+
--> $DIR/ub-int-array.rs:44:1
31
+
|
32
+
LL | / const UNINIT_INT_2: [u32; 3] = unsafe {
33
+
LL | |
34
+
LL | |
35
+
LL | | mem::transmute(
36
+
... |
37
+
LL | | )
38
+
LL | | };
39
+
| |__^ type validation failed: encountered uninitialized bytes at [2]
40
+
|
41
+
= 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.
42
+
43
+
error: aborting due to 3 previous errors
44
+
45
+
For more information about this error, try `rustc --explain E0080`.
| |__^ type validation failed: encountered undefined pointer
65
+
| |__^ type validation failed: encountered uninitialized reference
66
66
|
67
67
= 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.
| |__^ type validation failed: encountered undefined pointer
133
+
| |__^ type validation failed: encountered uninitialized raw pointer
134
134
|
135
135
= 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.
Copy file name to clipboardExpand all lines: src/test/ui/consts/const-eval/union-ice.stderr
+1-1
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ LL | | unsafe { UNION.field3 },
27
27
... |
28
28
LL | | a: 42,
29
29
LL | | };
30
-
| |__^ type validation failed: encountered undefined bytes at .b[1]
30
+
| |__^ type validation failed: encountered uninitialized bytes at .b[1]
31
31
|
32
32
= 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.
0 commit comments