@@ -155,7 +155,6 @@ impl<'a, 'tcx> FromIterator<Vec<&'a Pattern<'tcx>>> for Matrix<'a, 'tcx> {
155
155
//NOTE: appears to be the only place other then InferCtxt to contain a ParamEnv
156
156
pub struct MatchCheckCtxt < ' a , ' tcx : ' a > {
157
157
pub tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
158
- pub param_env : ty:: ParameterEnvironment < ' tcx > ,
159
158
/// A wild pattern with an error type - it exists to avoid having to normalize
160
159
/// associated types to get field types.
161
160
pub wild_pattern : & ' a Pattern < ' tcx > ,
@@ -165,7 +164,6 @@ pub struct MatchCheckCtxt<'a, 'tcx: 'a> {
165
164
impl < ' a , ' tcx > MatchCheckCtxt < ' a , ' tcx > {
166
165
pub fn create_and_enter < F , R > (
167
166
tcx : TyCtxt < ' a , ' tcx , ' tcx > ,
168
- param_env : ty:: ParameterEnvironment < ' tcx > ,
169
167
f : F ) -> R
170
168
where F : for < ' b > FnOnce ( MatchCheckCtxt < ' b , ' tcx > ) -> R
171
169
{
@@ -179,7 +177,6 @@ impl<'a, 'tcx> MatchCheckCtxt<'a, 'tcx> {
179
177
180
178
f ( MatchCheckCtxt {
181
179
tcx : tcx,
182
- param_env : param_env,
183
180
wild_pattern : & wild_pattern,
184
181
pattern_arena : & pattern_arena,
185
182
} )
@@ -675,18 +672,3 @@ fn specialize<'a, 'tcx>(
675
672
head
676
673
} )
677
674
}
678
-
679
- pub fn is_refutable < ' a , ' tcx , A , F > (
680
- cx : & MatchCheckCtxt < ' a , ' tcx > ,
681
- pat : & ' a Pattern < ' tcx > ,
682
- refutable : F )
683
- -> Option < A > where
684
- F : FnOnce ( & Witness ) -> A ,
685
- {
686
- let pats = Matrix ( vec ! [ vec![ pat] ] ) ;
687
- match is_useful ( cx, & pats, & [ cx. wild_pattern ] , ConstructWitness ) {
688
- UsefulWithWitness ( pats) => Some ( refutable ( & pats[ 0 ] ) ) ,
689
- NotUseful => None ,
690
- Useful => bug ! ( )
691
- }
692
- }
0 commit comments