1
1
use std:: fmt;
2
2
use std:: iter:: once;
3
3
4
- use rustc_arena:: { DroplessArena , TypedArena } ;
4
+ use rustc_arena:: DroplessArena ;
5
5
use rustc_hir:: def_id:: DefId ;
6
6
use rustc_hir:: HirId ;
7
7
use rustc_index:: { Idx , IndexVec } ;
@@ -62,7 +62,7 @@ impl<'tcx> RevealedTy<'tcx> {
62
62
}
63
63
64
64
#[ derive( Clone ) ]
65
- pub struct RustcMatchCheckCtxt < ' p , ' tcx > {
65
+ pub struct RustcMatchCheckCtxt < ' p , ' tcx : ' p > {
66
66
pub tcx : TyCtxt < ' tcx > ,
67
67
pub typeck_results : & ' tcx ty:: TypeckResults < ' tcx > ,
68
68
/// The module in which the match occurs. This is necessary for
@@ -72,8 +72,6 @@ pub struct RustcMatchCheckCtxt<'p, 'tcx> {
72
72
/// outside its module and should not be matchable with an empty match statement.
73
73
pub module : DefId ,
74
74
pub param_env : ty:: ParamEnv < ' tcx > ,
75
- /// To allocate lowered patterns
76
- pub pattern_arena : & ' p TypedArena < DeconstructedPat < ' p , ' tcx > > ,
77
75
/// To allocate the result of `self.ctor_sub_tys()`
78
76
pub dropless_arena : & ' p DroplessArena ,
79
77
/// Lint level at the match.
@@ -89,13 +87,13 @@ pub struct RustcMatchCheckCtxt<'p, 'tcx> {
89
87
pub known_valid_scrutinee : bool ,
90
88
}
91
89
92
- impl < ' p , ' tcx > fmt:: Debug for RustcMatchCheckCtxt < ' p , ' tcx > {
90
+ impl < ' p , ' tcx : ' p > fmt:: Debug for RustcMatchCheckCtxt < ' p , ' tcx > {
93
91
fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
94
92
f. debug_struct ( "RustcMatchCheckCtxt" ) . finish ( )
95
93
}
96
94
}
97
95
98
- impl < ' p , ' tcx > RustcMatchCheckCtxt < ' p , ' tcx > {
96
+ impl < ' p , ' tcx : ' p > RustcMatchCheckCtxt < ' p , ' tcx > {
99
97
/// Type inference occasionally gives us opaque types in places where corresponding patterns
100
98
/// have more specific types. To avoid inconsistencies as well as detect opaque uninhabited
101
99
/// types, we use the corresponding concrete type if possible.
@@ -844,7 +842,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> {
844
842
}
845
843
}
846
844
847
- impl < ' p , ' tcx > TypeCx for RustcMatchCheckCtxt < ' p , ' tcx > {
845
+ impl < ' p , ' tcx : ' p > TypeCx for RustcMatchCheckCtxt < ' p , ' tcx > {
848
846
type Ty = RevealedTy < ' tcx > ;
849
847
type Error = ErrorGuaranteed ;
850
848
type VariantIdx = VariantIdx ;
0 commit comments