Skip to content

Commit 25964b5

Browse files
committed
Reword the "unreachable pattern" explanations
1 parent 0f442e2 commit 25964b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+495
-495
lines changed

compiler/rustc_mir_build/messages.ftl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ mir_build_unreachable_making_this_unreachable = collectively making this unreach
330330
mir_build_unreachable_matches_same_values = matches some of the same values
331331
332332
mir_build_unreachable_pattern = unreachable pattern
333-
.label = unreachable pattern
334-
.unreachable_matches_no_values = this pattern matches no values because `{$ty}` is uninhabited
333+
.label = no value can reach this
334+
.unreachable_matches_no_values = matches no values because `{$ty}` is uninhabited
335335
.unreachable_covered_by_catchall = matches any value
336-
.unreachable_covered_by_one = matches all the values already
337-
.unreachable_covered_by_many = these patterns collectively make the last one unreachable
336+
.unreachable_covered_by_one = matches all the relevant values
337+
.unreachable_covered_by_many = multiple earlier patterns match some of the same values
338338
339339
mir_build_unsafe_fn_safe_body = an unsafe function restricts its caller, but its body is safe by default
340340
mir_build_unsafe_not_inherited = items do not inherit unsafety from separate enclosing items

tests/ui/consts/packed_pattern.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ warning: unreachable pattern
22
--> $DIR/packed_pattern.rs:16:9
33
|
44
LL | Foo { field: (5, 6, 7, 8) } => {},
5-
| --------------------------- matches all the values already
5+
| --------------------------- matches all the relevant values
66
LL | FOO => unreachable!(),
7-
| ^^^ unreachable pattern
7+
| ^^^ no value can reach this
88
|
99
= note: `#[warn(unreachable_patterns)]` on by default
1010

tests/ui/consts/packed_pattern2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ warning: unreachable pattern
22
--> $DIR/packed_pattern2.rs:24:9
33
|
44
LL | Bar { a: Foo { field: (5, 6) } } => {},
5-
| -------------------------------- matches all the values already
5+
| -------------------------------- matches all the relevant values
66
LL | FOO => unreachable!(),
7-
| ^^^ unreachable pattern
7+
| ^^^ no value can reach this
88
|
99
= note: `#[warn(unreachable_patterns)]` on by default
1010

tests/ui/error-codes/E0001.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ error: unreachable pattern
22
--> $DIR/E0001.rs:8:9
33
|
44
LL | _ => {/* ... */}
5-
| ^ unreachable pattern
5+
| ^ no value can reach this
66
|
7-
note: these patterns collectively make the last one unreachable
7+
note: multiple earlier patterns match some of the same values
88
--> $DIR/E0001.rs:8:9
99
|
1010
LL | Some(_) => {/* ... */}

tests/ui/lint/issue-30302.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ LL | Nil => true,
1313
| --- matches any value
1414
LL |
1515
LL | _ => false
16-
| ^ unreachable pattern
16+
| ^ no value can reach this
1717
|
1818
note: the lint level is defined here
1919
--> $DIR/issue-30302.rs:4:9

0 commit comments

Comments
 (0)