@@ -1230,11 +1230,10 @@ impl<'tcx> IntRange<'tcx> {
1230
1230
( * self . range . start ( ) , * self . range . end ( ) )
1231
1231
}
1232
1232
1233
- fn should_treat_range_exhaustively ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > ) -> bool {
1233
+ fn treat_exhaustively ( & self , tcx : TyCtxt < ' tcx > ) -> bool {
1234
1234
// Don't treat `usize`/`isize` exhaustively unless the `precise_pointer_size_matching`
1235
1235
// feature is enabled.
1236
- IntRange :: is_integral ( ty)
1237
- && ( !ty. is_ptr_sized_integral ( ) || tcx. features ( ) . precise_pointer_size_matching )
1236
+ !self . ty . is_ptr_sized_integral ( ) || tcx. features ( ) . precise_pointer_size_matching
1238
1237
}
1239
1238
1240
1239
#[ inline]
@@ -1360,7 +1359,7 @@ impl<'tcx> IntRange<'tcx> {
1360
1359
let ty = self . ty ;
1361
1360
let ( lo, hi) = self . boundaries ( ) ;
1362
1361
let ( other_lo, other_hi) = other. boundaries ( ) ;
1363
- if Self :: should_treat_range_exhaustively ( tcx, ty ) {
1362
+ if self . treat_exhaustively ( tcx) {
1364
1363
if lo <= other_hi && other_lo <= hi {
1365
1364
let span = other. span ;
1366
1365
Some ( IntRange { range : max ( lo, other_lo) ..=min ( hi, other_hi) , ty, span } )
@@ -1858,7 +1857,7 @@ fn split_grouped_constructors<'p, 'tcx>(
1858
1857
1859
1858
for ctor in ctors. into_iter ( ) {
1860
1859
match ctor {
1861
- IntRange ( ctor_range) if IntRange :: should_treat_range_exhaustively ( tcx, ty ) => {
1860
+ IntRange ( ctor_range) if ctor_range . treat_exhaustively ( tcx) => {
1862
1861
// Fast-track if the range is trivial. In particular, don't do the overlapping
1863
1862
// ranges check.
1864
1863
if ctor_range. is_singleton ( ) {
0 commit comments