Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/rustc_middle/messages.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ middle_failed_writing_file =
# Note: We only mention patterns here since the error can only occur with references, and those
# are forbidden in const generics.
middle_invalid_const_in_valtree = constant {$global_const_id} cannot be used as pattern
.note = constants that reference mutable or external memory cannot be used as pattern
.note = constants that reference mutable or external memory cannot be used as patterns

middle_layout_cycle =
a cycle occurred during layout computation
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/consts/const_refs_to_static_fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ error: constant BAD_PATTERN cannot be used as pattern
LL | BAD_PATTERN => {},
| ^^^^^^^^^^^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: aborting due to 3 previous errors

Expand Down
4 changes: 2 additions & 2 deletions tests/ui/consts/const_refs_to_static_fail_invalid.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ error: constant extern_::C cannot be used as pattern
LL | C => {}
| ^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: constant mutable::C cannot be used as pattern
--> $DIR/const_refs_to_static_fail_invalid.rs:42:9
|
LL | C => {}
| ^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: aborting due to 3 previous errors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ error: constant REF_INTERIOR_MUT cannot be used as pattern
LL | REF_INTERIOR_MUT => {},
| ^^^^^^^^^^^^^^^^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

warning: skipping const checks
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ error: constant SLICE_MUT cannot be used as pattern
LL | SLICE_MUT => true,
| ^^^^^^^^^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: constant U8_MUT cannot be used as pattern
--> $DIR/const_refers_to_static_cross_crate.rs:44:9
|
LL | U8_MUT => true,
| ^^^^^^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: constant U8_MUT2 cannot be used as pattern
--> $DIR/const_refers_to_static_cross_crate.rs:53:9
|
LL | U8_MUT2 => true,
| ^^^^^^^
|
= note: constants that reference mutable or external memory cannot be used as pattern
= note: constants that reference mutable or external memory cannot be used as patterns

error: aborting due to 4 previous errors

Expand Down
Loading