@@ -3,7 +3,6 @@ use std::fmt;
3
3
use rustc_abi:: { FieldIdx , VariantIdx } ;
4
4
use rustc_index:: IndexVec ;
5
5
use rustc_index:: bit_set:: BitSet ;
6
- use rustc_infer:: traits:: Reveal ;
7
6
use rustc_middle:: mir:: patch:: MirPatch ;
8
7
use rustc_middle:: mir:: * ;
9
8
use rustc_middle:: ty:: { self , TyCtxt } ;
@@ -13,7 +12,7 @@ use rustc_mir_dataflow::elaborate_drops::{
13
12
use rustc_mir_dataflow:: impls:: { MaybeInitializedPlaces , MaybeUninitializedPlaces } ;
14
13
use rustc_mir_dataflow:: move_paths:: { LookupResult , MoveData , MovePathIndex } ;
15
14
use rustc_mir_dataflow:: {
16
- Analysis , MoveDataParamEnv , ResultsCursor , on_all_children_bits, on_lookup_result_bits,
15
+ Analysis , MoveDataTypingEnv , ResultsCursor , on_all_children_bits, on_lookup_result_bits,
17
16
} ;
18
17
use rustc_span:: Span ;
19
18
use tracing:: { debug, instrument} ;
@@ -61,7 +60,7 @@ impl<'tcx> crate::MirPass<'tcx> for ElaborateDrops {
61
60
// init/uninit for types that do need dropping.
62
61
let move_data = MoveData :: gather_moves ( body, tcx, |ty| ty. needs_drop ( tcx, typing_env) ) ;
63
62
let elaborate_patch = {
64
- let env = MoveDataParamEnv { move_data, param_env : typing_env. param_env } ;
63
+ let env = MoveDataTypingEnv { move_data, typing_env } ;
65
64
66
65
let mut inits = MaybeInitializedPlaces :: new ( tcx, body, & env. move_data )
67
66
. skipping_unreachable_unwind ( )
@@ -149,7 +148,7 @@ impl<'a, 'tcx> DropElaborator<'a, 'tcx> for ElaborateDropsCtxt<'a, 'tcx> {
149
148
}
150
149
151
150
fn typing_env ( & self ) -> ty:: TypingEnv < ' tcx > {
152
- self . typing_env ( )
151
+ self . env . typing_env
153
152
}
154
153
155
154
#[ instrument( level = "debug" , skip( self ) , ret) ]
@@ -230,7 +229,7 @@ impl<'a, 'tcx> DropElaborator<'a, 'tcx> for ElaborateDropsCtxt<'a, 'tcx> {
230
229
struct ElaborateDropsCtxt < ' a , ' tcx > {
231
230
tcx : TyCtxt < ' tcx > ,
232
231
body : & ' a Body < ' tcx > ,
233
- env : & ' a MoveDataParamEnv < ' tcx > ,
232
+ env : & ' a MoveDataTypingEnv < ' tcx > ,
234
233
init_data : InitializationData < ' a , ' tcx > ,
235
234
drop_flags : IndexVec < MovePathIndex , Option < Local > > ,
236
235
patch : MirPatch < ' tcx > ,
@@ -247,15 +246,6 @@ impl<'a, 'tcx> ElaborateDropsCtxt<'a, 'tcx> {
247
246
& self . env . move_data
248
247
}
249
248
250
- fn param_env ( & self ) -> ty:: ParamEnv < ' tcx > {
251
- self . env . param_env
252
- }
253
-
254
- fn typing_env ( & self ) -> ty:: TypingEnv < ' tcx > {
255
- debug_assert_eq ! ( self . param_env( ) . reveal( ) , Reveal :: All ) ;
256
- ty:: TypingEnv { typing_mode : ty:: TypingMode :: PostAnalysis , param_env : self . param_env ( ) }
257
- }
258
-
259
249
fn create_drop_flag ( & mut self , index : MovePathIndex , span : Span ) {
260
250
let patch = & mut self . patch ;
261
251
debug ! ( "create_drop_flag({:?})" , self . body. span) ;
0 commit comments