@@ -8,7 +8,6 @@ use rustc_hir::HirId;
88use rustc_hir:: def_id:: DefId ;
99use rustc_index:: { Idx , IndexVec } ;
1010use rustc_middle:: middle:: stability:: EvalResult ;
11- use rustc_middle:: mir:: { self , Const } ;
1211use rustc_middle:: thir:: { self , Pat , PatKind , PatRange , PatRangeBoundary } ;
1312use rustc_middle:: ty:: layout:: IntegerExt ;
1413use rustc_middle:: ty:: {
@@ -580,9 +579,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
580579 // subfields.
581580 // Note: `t` is `str`, not `&str`.
582581 let ty = self . reveal_opaque_ty ( * t) ;
583- // FIXME: why does `Str` need a `mir::Const`?
584- let val = mir:: Const :: from_ty_value ( self . tcx , * value) ;
585- let subpattern = DeconstructedPat :: new ( Str ( val) , Vec :: new ( ) , 0 , ty, pat) ;
582+ let subpattern = DeconstructedPat :: new ( Str ( * value) , Vec :: new ( ) , 0 , ty, pat) ;
586583 ctor = Ref ;
587584 fields = vec ! [ subpattern. at_index( 0 ) ] ;
588585 arity = 1 ;
@@ -894,7 +891,7 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
894891 type Ty = RevealedTy < ' tcx > ;
895892 type Error = ErrorGuaranteed ;
896893 type VariantIdx = VariantIdx ;
897- type StrLit = Const < ' tcx > ;
894+ type StrLit = ty :: Value < ' tcx > ;
898895 type ArmData = HirId ;
899896 type PatData = & ' p Pat < ' tcx > ;
900897
0 commit comments