about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorhelldawg <116204326+helldawg@users.noreply.github.com>2025-09-19 04:59:14 +0300
committerhelldawg <116204326+helldawg@users.noreply.github.com>2025-09-25 18:15:04 +0300
commit7e58c9110521d960cb97e730dfe700b3ec64c9ab (patch)
treea422e6b8958a83891f467bf58c070c902066d47e /compiler
parent7cfd7d328b14b936c7ffede92cacebe8557c6388 (diff)
downloadrust-7e58c9110521d960cb97e730dfe700b3ec64c9ab.tar.gz
rust-7e58c9110521d960cb97e730dfe700b3ec64c9ab.zip
usize/isize range matching error clarification
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/check_match.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
index ae67bb5075e..3929a97eed8 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/check_match.rs
@@ -1275,13 +1275,13 @@ fn report_non_exhaustive_match<'p, 'tcx>(
             if ty.is_ptr_sized_integral() {
                 if ty.inner() == cx.tcx.types.usize {
                     err.note(format!(
-                        "`{ty}` does not have a fixed maximum value, so half-open ranges are \
-                         necessary to match exhaustively",
+                        "`{ty}::MAX` is not treated as exhaustive, \
+                        so half-open ranges are necessary to match exhaustively",
                     ));
                 } else if ty.inner() == cx.tcx.types.isize {
                     err.note(format!(
-                        "`{ty}` does not have fixed minimum and maximum values, so half-open \
-                         ranges are necessary to match exhaustively",
+                        "`{ty}::MIN` and `{ty}::MAX` are not treated as exhaustive, \
+                        so half-open ranges are necessary to match exhaustively",
                     ));
                 }
             } else if ty.inner() == cx.tcx.types.str_ {