Skip to content

Commit 8c36e50

Browse files
committed
adjustment
1 parent a8aceaa commit 8c36e50

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,14 +1275,13 @@ fn report_non_exhaustive_match<'p, 'tcx>(
12751275
if ty.is_ptr_sized_integral() {
12761276
if ty.inner() == cx.tcx.types.usize {
12771277
err.note(format!(
1278-
"`{ty}::MAX` is a runtime value and cannot be used for exhaustiveness checking, \
1279-
so half-open ranges are necessary to match exhaustively",
1278+
"`{ty}::MAX` is not accessible as a fixed value, so half-open ranges are \
1279+
necessary to match exhaustively",
12801280
));
12811281
} else if ty.inner() == cx.tcx.types.isize {
12821282
err.note(format!(
1283-
"`isize::MIN` and `isize::MAX` are runtime values and cannot \
1284-
be used for exhaustiveness checking, so half-open ranges are necessary \
1285-
to match exhaustively",
1283+
"The minimum and maximum values of `{ty}` are not directly accessible, so half-open \
1284+
ranges are necessary to match exhaustively",
12861285
));
12871286
}
12881287
} else if ty.inner() == cx.tcx.types.str_ {

0 commit comments

Comments
 (0)