11use std:: fmt;
22use std:: iter:: once;
33
4- use rustc_arena:: { DroplessArena , TypedArena } ;
4+ use rustc_arena:: DroplessArena ;
55use rustc_hir:: def_id:: DefId ;
66use rustc_hir:: HirId ;
77use rustc_index:: { Idx , IndexVec } ;
@@ -62,7 +62,7 @@ impl<'tcx> RevealedTy<'tcx> {
6262}
6363
6464#[ derive( Clone ) ]
65- pub struct RustcMatchCheckCtxt < ' p , ' tcx > {
65+ pub struct RustcMatchCheckCtxt < ' p , ' tcx : ' p > {
6666 pub tcx : TyCtxt < ' tcx > ,
6767 pub typeck_results : & ' tcx ty:: TypeckResults < ' tcx > ,
6868 /// The module in which the match occurs. This is necessary for
@@ -72,8 +72,6 @@ pub struct RustcMatchCheckCtxt<'p, 'tcx> {
7272 /// outside its module and should not be matchable with an empty match statement.
7373 pub module : DefId ,
7474 pub param_env : ty:: ParamEnv < ' tcx > ,
75- /// To allocate lowered patterns
76- pub pattern_arena : & ' p TypedArena < DeconstructedPat < ' p , ' tcx > > ,
7775 /// To allocate the result of `self.ctor_sub_tys()`
7876 pub dropless_arena : & ' p DroplessArena ,
7977 /// Lint level at the match.
@@ -89,13 +87,13 @@ pub struct RustcMatchCheckCtxt<'p, 'tcx> {
8987 pub known_valid_scrutinee : bool ,
9088}
9189
92- impl < ' p , ' tcx > fmt:: Debug for RustcMatchCheckCtxt < ' p , ' tcx > {
90+ impl < ' p , ' tcx : ' p > fmt:: Debug for RustcMatchCheckCtxt < ' p , ' tcx > {
9391 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
9492 f. debug_struct ( "RustcMatchCheckCtxt" ) . finish ( )
9593 }
9694}
9795
98- impl < ' p , ' tcx > RustcMatchCheckCtxt < ' p , ' tcx > {
96+ impl < ' p , ' tcx : ' p > RustcMatchCheckCtxt < ' p , ' tcx > {
9997 /// Type inference occasionally gives us opaque types in places where corresponding patterns
10098 /// have more specific types. To avoid inconsistencies as well as detect opaque uninhabited
10199 /// types, we use the corresponding concrete type if possible.
@@ -844,7 +842,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> {
844842 }
845843}
846844
847- impl < ' p , ' tcx > TypeCx for RustcMatchCheckCtxt < ' p , ' tcx > {
845+ impl < ' p , ' tcx : ' p > TypeCx for RustcMatchCheckCtxt < ' p , ' tcx > {
848846 type Ty = RevealedTy < ' tcx > ;
849847 type Error = ErrorGuaranteed ;
850848 type VariantIdx = VariantIdx ;
0 commit comments