@@ -3,7 +3,6 @@ use std::fmt;
33use rustc_abi:: { FieldIdx , VariantIdx } ;
44use rustc_index:: IndexVec ;
55use rustc_index:: bit_set:: BitSet ;
6- use rustc_infer:: traits:: Reveal ;
76use rustc_middle:: mir:: patch:: MirPatch ;
87use rustc_middle:: mir:: * ;
98use rustc_middle:: ty:: { self , TyCtxt } ;
@@ -13,7 +12,7 @@ use rustc_mir_dataflow::elaborate_drops::{
1312use rustc_mir_dataflow:: impls:: { MaybeInitializedPlaces , MaybeUninitializedPlaces } ;
1413use rustc_mir_dataflow:: move_paths:: { LookupResult , MoveData , MovePathIndex } ;
1514use 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,
1716} ;
1817use rustc_span:: Span ;
1918use tracing:: { debug, instrument} ;
@@ -61,7 +60,7 @@ impl<'tcx> crate::MirPass<'tcx> for ElaborateDrops {
6160 // init/uninit for types that do need dropping.
6261 let move_data = MoveData :: gather_moves ( body, tcx, |ty| ty. needs_drop ( tcx, typing_env) ) ;
6362 let elaborate_patch = {
64- let env = MoveDataParamEnv { move_data, param_env : typing_env. param_env } ;
63+ let env = MoveDataTypingEnv { move_data, typing_env } ;
6564
6665 let mut inits = MaybeInitializedPlaces :: new ( tcx, body, & env. move_data )
6766 . skipping_unreachable_unwind ( )
@@ -149,7 +148,7 @@ impl<'a, 'tcx> DropElaborator<'a, 'tcx> for ElaborateDropsCtxt<'a, 'tcx> {
149148 }
150149
151150 fn typing_env ( & self ) -> ty:: TypingEnv < ' tcx > {
152- self . typing_env ( )
151+ self . env . typing_env
153152 }
154153
155154 #[ instrument( level = "debug" , skip( self ) , ret) ]
@@ -230,7 +229,7 @@ impl<'a, 'tcx> DropElaborator<'a, 'tcx> for ElaborateDropsCtxt<'a, 'tcx> {
230229struct ElaborateDropsCtxt < ' a , ' tcx > {
231230 tcx : TyCtxt < ' tcx > ,
232231 body : & ' a Body < ' tcx > ,
233- env : & ' a MoveDataParamEnv < ' tcx > ,
232+ env : & ' a MoveDataTypingEnv < ' tcx > ,
234233 init_data : InitializationData < ' a , ' tcx > ,
235234 drop_flags : IndexVec < MovePathIndex , Option < Local > > ,
236235 patch : MirPatch < ' tcx > ,
@@ -247,15 +246,6 @@ impl<'a, 'tcx> ElaborateDropsCtxt<'a, 'tcx> {
247246 & self . env . move_data
248247 }
249248
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-
259249 fn create_drop_flag ( & mut self , index : MovePathIndex , span : Span ) {
260250 let patch = & mut self . patch ;
261251 debug ! ( "create_drop_flag({:?})" , self . body. span) ;
0 commit comments