@@ -8,7 +8,6 @@ use rustc_hir::HirId;
8
8
use rustc_hir:: def_id:: DefId ;
9
9
use rustc_index:: { Idx , IndexVec } ;
10
10
use rustc_middle:: middle:: stability:: EvalResult ;
11
- use rustc_middle:: mir:: { self , Const } ;
12
11
use rustc_middle:: thir:: { self , Pat , PatKind , PatRange , PatRangeBoundary } ;
13
12
use rustc_middle:: ty:: layout:: IntegerExt ;
14
13
use rustc_middle:: ty:: {
@@ -580,9 +579,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> {
580
579
// subfields.
581
580
// Note: `t` is `str`, not `&str`.
582
581
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) ;
586
583
ctor = Ref ;
587
584
fields = vec ! [ subpattern. at_index( 0 ) ] ;
588
585
arity = 1 ;
@@ -894,7 +891,7 @@ impl<'p, 'tcx: 'p> PatCx for RustcPatCtxt<'p, 'tcx> {
894
891
type Ty = RevealedTy < ' tcx > ;
895
892
type Error = ErrorGuaranteed ;
896
893
type VariantIdx = VariantIdx ;
897
- type StrLit = Const < ' tcx > ;
894
+ type StrLit = ty :: Value < ' tcx > ;
898
895
type ArmData = HirId ;
899
896
type PatData = & ' p Pat < ' tcx > ;
900
897
0 commit comments