@@ -85,7 +85,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
8585 test_place : & PlaceBuilder < ' tcx > ,
8686 candidate : & Candidate < ' pat , ' tcx > ,
8787 switch_ty : Ty < ' tcx > ,
88- options : & mut FxIndexMap < & ' tcx ty :: Const < ' tcx > , u128 > ,
88+ options : & mut FxIndexMap < ConstantKind < ' tcx > , u128 > ,
8989 ) -> bool {
9090 let match_pair = match candidate. match_pairs . iter ( ) . find ( |mp| mp. place == * test_place) {
9191 Some ( match_pair) => match_pair,
@@ -262,7 +262,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
262262 ty,
263263 ) ;
264264 } else if let [ success, fail] = * make_target_blocks ( self ) {
265- assert_eq ! ( value. ty, ty) ;
265+ assert_eq ! ( value. ty( ) , ty) ;
266266 let expect = self . literal_operand ( test. span , value) ;
267267 let val = Operand :: Copy ( place) ;
268268 self . compare ( block, success, fail, source_info, BinOp :: Eq , expect, val) ;
@@ -364,7 +364,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
364364 block : BasicBlock ,
365365 make_target_blocks : impl FnOnce ( & mut Self ) -> Vec < BasicBlock > ,
366366 source_info : SourceInfo ,
367- value : & ' tcx ty :: Const < ' tcx > ,
367+ value : ConstantKind < ' tcx > ,
368368 place : Place < ' tcx > ,
369369 mut ty : Ty < ' tcx > ,
370370 ) {
@@ -385,7 +385,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
385385 _ => None ,
386386 } ;
387387 let opt_ref_ty = unsize ( ty) ;
388- let opt_ref_test_ty = unsize ( value. ty ) ;
388+ let opt_ref_test_ty = unsize ( value. ty ( ) ) ;
389389 match ( opt_ref_ty, opt_ref_test_ty) {
390390 // nothing to do, neither is an array
391391 ( None , None ) => { }
@@ -773,16 +773,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
773773 fn const_range_contains (
774774 & self ,
775775 range : PatRange < ' tcx > ,
776- value : & ' tcx ty :: Const < ' tcx > ,
776+ value : ConstantKind < ' tcx > ,
777777 ) -> Option < bool > {
778778 use std:: cmp:: Ordering :: * ;
779779
780780 let tcx = self . tcx ;
781781
782- let lo = ty :: Const :: from_value ( tcx , ConstValue :: Scalar ( range. lo . into ( ) ) , value. ty ) ;
783- let hi = ty :: Const :: from_value ( tcx , ConstValue :: Scalar ( range. hi . into ( ) ) , value. ty ) ;
784- let a = compare_const_vals ( tcx, lo, value, self . param_env , value. ty ) ?;
785- let b = compare_const_vals ( tcx, value, hi, self . param_env , value. ty ) ?;
782+ let lo = ConstantKind :: Val ( ConstValue :: Scalar ( range. lo . into ( ) ) , value. ty ( ) ) ;
783+ let hi = ConstantKind :: Val ( ConstValue :: Scalar ( range. hi . into ( ) ) , value. ty ( ) ) ;
784+ let a = compare_const_vals ( tcx, lo, value, self . param_env , value. ty ( ) ) ?;
785+ let b = compare_const_vals ( tcx, value, hi, self . param_env , value. ty ( ) ) ?;
786786
787787 match ( b, range. end ) {
788788 ( Less , _) | ( Equal , RangeEnd :: Included ) if a != Greater => Some ( true ) ,
@@ -793,7 +793,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
793793 fn values_not_contained_in_range (
794794 & self ,
795795 range : PatRange < ' tcx > ,
796- options : & FxIndexMap < & ' tcx ty :: Const < ' tcx > , u128 > ,
796+ options : & FxIndexMap < ConstantKind < ' tcx > , u128 > ,
797797 ) -> Option < bool > {
798798 for & val in options. keys ( ) {
799799 if self . const_range_contains ( range, val) ? {
0 commit comments