@@ -1282,11 +1282,10 @@ impl<'tcx> IntRange<'tcx> {
1282
1282
( * self . range . start ( ) , * self . range . end ( ) )
1283
1283
}
1284
1284
1285
- fn should_treat_range_exhaustively ( tcx : TyCtxt < ' tcx > , ty : Ty < ' tcx > ) -> bool {
1285
+ fn treat_exhaustively ( & self , tcx : TyCtxt < ' tcx > ) -> bool {
1286
1286
// Don't treat `usize`/`isize` exhaustively unless the `precise_pointer_size_matching`
1287
1287
// feature is enabled.
1288
- IntRange :: is_integral ( ty)
1289
- && ( !ty. is_ptr_sized_integral ( ) || tcx. features ( ) . precise_pointer_size_matching )
1288
+ !self . ty . is_ptr_sized_integral ( ) || tcx. features ( ) . precise_pointer_size_matching
1290
1289
}
1291
1290
1292
1291
#[ inline]
@@ -1414,7 +1413,7 @@ impl<'tcx> IntRange<'tcx> {
1414
1413
let ty = self . ty ;
1415
1414
let ( lo, hi) = self . boundaries ( ) ;
1416
1415
let ( other_lo, other_hi) = other. boundaries ( ) ;
1417
- if Self :: should_treat_range_exhaustively ( tcx, ty ) {
1416
+ if self . treat_exhaustively ( tcx) {
1418
1417
if lo <= other_hi && other_lo <= hi {
1419
1418
let span = other. span ;
1420
1419
Some ( IntRange { range : max ( lo, other_lo) ..=min ( hi, other_hi) , ty, span } )
@@ -1881,7 +1880,7 @@ fn split_grouped_constructors<'p, 'tcx>(
1881
1880
1882
1881
for ctor in ctors. into_iter ( ) {
1883
1882
match ctor {
1884
- IntRange ( ctor_range) if IntRange :: should_treat_range_exhaustively ( tcx, ty ) => {
1883
+ IntRange ( ctor_range) if ctor_range . treat_exhaustively ( tcx) => {
1885
1884
// Fast-track if the range is trivial. In particular, don't do the overlapping
1886
1885
// ranges check.
1887
1886
if ctor_range. is_singleton ( ) {
0 commit comments