diff options
| author | helldawg <116204326+helldawg@users.noreply.github.com> | 2025-09-19 04:59:14 +0300 |
|---|---|---|
| committer | helldawg <116204326+helldawg@users.noreply.github.com> | 2025-09-25 18:15:04 +0300 |
| commit | 7e58c9110521d960cb97e730dfe700b3ec64c9ab (patch) | |
| tree | a422e6b8958a83891f467bf58c070c902066d47e /compiler | |
| parent | 7cfd7d328b14b936c7ffede92cacebe8557c6388 (diff) | |
| download | rust-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.rs | 8 |
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_ { |
