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
Copy file name to clipboardExpand all lines: compiler/rustc_const_eval/messages.ftl
-2
Original file line number
Diff line number
Diff line change
@@ -406,7 +406,6 @@ const_eval_upcast_mismatch =
406
406
407
407
## The `front_matter`s here refer to either `const_eval_front_matter_invalid_value` or `const_eval_front_matter_invalid_value_with_path`.
408
408
## (We'd love to sort this differently to make that more clear but tidy won't let us...)
409
-
const_eval_validation_box_to_mut = {$front_matter}: encountered a box pointing to mutable memory in a constant
410
409
const_eval_validation_box_to_static = {$front_matter}: encountered a box pointing to a static variable in a constant
411
410
const_eval_validation_box_to_uninhabited = {$front_matter}: encountered a box pointing to uninhabited type {$ty}
412
411
const_eval_validation_dangling_box_no_provenance = {$front_matter}: encountered a dangling box ({$pointer} has no provenance)
@@ -452,7 +451,6 @@ const_eval_validation_out_of_range = {$front_matter}: encountered {$value}, but
452
451
const_eval_validation_partial_pointer = {$front_matter}: encountered a partial pointer or a mix of pointers
453
452
const_eval_validation_pointer_as_int = {$front_matter}: encountered a pointer, but {$expected}
454
453
const_eval_validation_ptr_out_of_range = {$front_matter}: encountered a pointer, but expected something that cannot possibly fail to be {$in_range}
455
-
const_eval_validation_ref_to_mut = {$front_matter}: encountered a reference pointing to mutable memory in a constant
456
454
const_eval_validation_ref_to_static = {$front_matter}: encountered a reference pointing to a static variable in a constant
457
455
const_eval_validation_ref_to_uninhabited = {$front_matter}: encountered a reference pointing to uninhabited type {$ty}
458
456
const_eval_validation_unaligned_box = {$front_matter}: encountered an unaligned box (required {$required_bytes} byte alignment but found {$found_bytes})
error[E0080]: it is undefined behavior to use this value
42
+
--> $DIR/const_refers_to_static.rs:34:1
43
+
|
44
+
LL | const REF_IMMUT: &u8 = &MY_STATIC;
45
+
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
46
+
|
47
+
= 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.
48
+
= note: the raw bytes of the constant (size: 4, align: 4) {
49
+
╾ALLOC2╼ │ ╾──╼
50
+
}
51
+
41
52
warning: skipping const checks
42
53
|
43
54
help: skipping check that does not even have a feature gate
@@ -75,7 +86,12 @@ help: skipping check that does not even have a feature gate
75
86
|
76
87
LL | &FOO
77
88
| ^^^
89
+
help: skipping check that does not even have a feature gate
90
+
--> $DIR/const_refers_to_static.rs:34:25
91
+
|
92
+
LL | const REF_IMMUT: &u8 = &MY_STATIC;
93
+
| ^^^^^^^^^
78
94
79
-
error: aborting due to 5 previous errors; 1 warning emitted
95
+
error: aborting due to 6 previous errors; 1 warning emitted
80
96
81
97
For more information about this error, try `rustc --explain E0080`.
error[E0080]: it is undefined behavior to use this value
42
+
--> $DIR/const_refers_to_static.rs:34:1
43
+
|
44
+
LL | const REF_IMMUT: &u8 = &MY_STATIC;
45
+
| ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
46
+
|
47
+
= 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.
48
+
= note: the raw bytes of the constant (size: 8, align: 8) {
49
+
╾ALLOC2╼ │ ╾──────╼
50
+
}
51
+
41
52
warning: skipping const checks
42
53
|
43
54
help: skipping check that does not even have a feature gate
@@ -75,7 +86,12 @@ help: skipping check that does not even have a feature gate
75
86
|
76
87
LL | &FOO
77
88
| ^^^
89
+
help: skipping check that does not even have a feature gate
90
+
--> $DIR/const_refers_to_static.rs:34:25
91
+
|
92
+
LL | const REF_IMMUT: &u8 = &MY_STATIC;
93
+
| ^^^^^^^^^
78
94
79
-
error: aborting due to 5 previous errors; 1 warning emitted
95
+
error: aborting due to 6 previous errors; 1 warning emitted
80
96
81
97
For more information about this error, try `rustc --explain E0080`.
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
61
+
|
62
+
= 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
+
= note: the raw bytes of the constant (size: 4, align: 4) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to a static variable in a constant
61
+
|
62
+
= 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
+
= note: the raw bytes of the constant (size: 8, align: 8) {
0 commit comments