@@ -856,7 +856,7 @@ impl<'tcx> IntRange<'tcx> {
856856 }
857857 ConstantValue ( val) if is_integral ( val. ty ) => {
858858 let ty = val. ty ;
859- if let Some ( val) = val. assert_bits ( tcx, ty:: ParamEnv :: empty ( ) . and ( ty ) ) {
859+ if let Some ( val) = val. assert_bits ( tcx, ty) {
860860 let bias = IntRange :: signed_bias ( tcx, ty) ;
861861 let val = val ^ bias;
862862 Some ( IntRange { range : val..=val, ty } )
@@ -873,8 +873,8 @@ impl<'tcx> IntRange<'tcx> {
873873 match pat. kind {
874874 box PatternKind :: Constant { value } => break ConstantValue ( value) ,
875875 box PatternKind :: Range ( PatternRange { lo, hi, ty, end } ) => break ConstantRange (
876- lo. to_bits ( tcx, ty:: ParamEnv :: empty ( ) . and ( ty ) ) . unwrap ( ) ,
877- hi. to_bits ( tcx, ty:: ParamEnv :: empty ( ) . and ( ty ) ) . unwrap ( ) ,
876+ lo. unwrap_bits ( tcx, ty) ,
877+ hi. unwrap_bits ( tcx, ty) ,
878878 ty,
879879 end,
880880 ) ,
@@ -1327,8 +1327,8 @@ fn pat_constructors<'tcx>(cx: &mut MatchCheckCtxt<'_, 'tcx>,
13271327 PatternKind :: Constant { value } => Some ( vec ! [ ConstantValue ( value) ] ) ,
13281328 PatternKind :: Range ( PatternRange { lo, hi, ty, end } ) =>
13291329 Some ( vec ! [ ConstantRange (
1330- lo. to_bits ( cx. tcx, ty:: ParamEnv :: empty ( ) . and ( ty ) ) . unwrap ( ) ,
1331- hi. to_bits ( cx. tcx, ty:: ParamEnv :: empty ( ) . and ( ty ) ) . unwrap ( ) ,
1330+ lo. unwrap_bits ( cx. tcx, ty) ,
1331+ hi. unwrap_bits ( cx. tcx, ty) ,
13321332 ty,
13331333 end,
13341334 ) ] ) ,
@@ -1464,7 +1464,7 @@ fn slice_pat_covered_by_const<'tcx>(
14641464 {
14651465 match pat. kind {
14661466 box PatternKind :: Constant { value } => {
1467- let b = value. unwrap_bits ( tcx, ty :: ParamEnv :: empty ( ) . and ( pat. ty ) ) ;
1467+ let b = value. unwrap_bits ( tcx, pat. ty ) ;
14681468 assert_eq ! ( b as u8 as u128 , b) ;
14691469 if b as u8 != * ch {
14701470 return Ok ( false ) ;
@@ -1641,9 +1641,9 @@ fn constructor_covered_by_range<'tcx>(
16411641 _ => bug ! ( "`constructor_covered_by_range` called with {:?}" , pat) ,
16421642 } ;
16431643 trace ! ( "constructor_covered_by_range {:#?}, {:#?}, {:#?}, {}" , ctor, from, to, ty) ;
1644- let cmp_from = |c_from| compare_const_vals ( tcx, c_from, from, ty:: ParamEnv :: empty ( ) . and ( ty ) )
1644+ let cmp_from = |c_from| compare_const_vals ( tcx, c_from, from, ty)
16451645 . map ( |res| res != Ordering :: Less ) ;
1646- let cmp_to = |c_to| compare_const_vals ( tcx, c_to, to, ty:: ParamEnv :: empty ( ) . and ( ty ) ) ;
1646+ let cmp_to = |c_to| compare_const_vals ( tcx, c_to, to, ty) ;
16471647 macro_rules! some_or_ok {
16481648 ( $e: expr) => {
16491649 match $e {
0 commit comments