@@ -124,8 +124,7 @@ struct ElaborateDropsCtxt<'a, 'tcx: 'a> {
124124
125125#[ derive( Copy , Clone , Debug ) ]
126126struct DropCtxt < ' a , ' tcx : ' a > {
127- span : Span ,
128- scope : ScopeId ,
127+ source_info : SourceInfo ,
129128 is_cleanup : bool ,
130129
131130 init_data : & ' a InitializationData ,
@@ -273,8 +272,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
273272 let init_data = self . initialization_data_at ( loc) ;
274273 let path = self . move_data ( ) . rev_lookup . find ( location) ;
275274 self . elaborate_drop ( & DropCtxt {
276- span : terminator. span ,
277- scope : terminator. scope ,
275+ source_info : terminator. source_info ,
278276 is_cleanup : data. is_cleanup ,
279277 init_data : & init_data,
280278 lvalue : location,
@@ -329,8 +327,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
329327
330328 let assign = Statement {
331329 kind : StatementKind :: Assign ( location. clone ( ) , Rvalue :: Use ( value. clone ( ) ) ) ,
332- span : terminator. span ,
333- scope : terminator. scope
330+ source_info : terminator. source_info
334331 } ;
335332
336333 let unwind = unwind. unwrap_or ( self . patch . resume_block ( ) ) ;
@@ -367,8 +364,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
367364 let path = self . move_data ( ) . rev_lookup . find ( location) ;
368365
369366 self . elaborate_drop ( & DropCtxt {
370- span : terminator. span ,
371- scope : terminator. scope ,
367+ source_info : terminator. source_info ,
372368 is_cleanup : data. is_cleanup ,
373369 init_data : & init_data,
374370 lvalue : location,
@@ -513,8 +509,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
513509 debug ! ( "drop_ladder: for std field {} ({:?})" , i, lv) ;
514510
515511 self . elaborated_drop_block ( & DropCtxt {
516- span : c. span ,
517- scope : c. scope ,
512+ source_info : c. source_info ,
518513 is_cleanup : is_cleanup,
519514 init_data : c. init_data ,
520515 lvalue : lv,
@@ -527,8 +522,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
527522 debug ! ( "drop_ladder: for rest field {} ({:?})" , i, lv) ;
528523
529524 let blk = self . complete_drop ( & DropCtxt {
530- span : c. span ,
531- scope : c. scope ,
525+ source_info : c. source_info ,
532526 is_cleanup : is_cleanup,
533527 init_data : c. init_data ,
534528 lvalue : lv,
@@ -785,7 +779,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
785779 self . patch . new_block ( BasicBlockData {
786780 statements : vec ! [ ] ,
787781 terminator : Some ( Terminator {
788- scope : c. scope , span : c . span , kind : k
782+ source_info : c. source_info , kind : k
789783 } ) ,
790784 is_cleanup : is_cleanup
791785 } )
@@ -858,11 +852,10 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
858852 let mut statements = vec ! [ ] ;
859853 if let Some ( & flag) = self . drop_flags . get ( & c. path ) {
860854 statements. push ( Statement {
861- span : c. span ,
862- scope : c. scope ,
855+ source_info : c. source_info ,
863856 kind : StatementKind :: Assign (
864857 Lvalue :: Temp ( flag) ,
865- self . constant_bool ( c. span , false )
858+ self . constant_bool ( c. source_info . span , false )
866859 )
867860 } ) ;
868861 }
@@ -880,9 +873,9 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
880873 self . patch . new_block ( BasicBlockData {
881874 statements : statements,
882875 terminator : Some ( Terminator {
883- scope : c. scope , span : c . span , kind : TerminatorKind :: Call {
876+ source_info : c. source_info , kind : TerminatorKind :: Call {
884877 func : Operand :: Constant ( Constant {
885- span : c. span ,
878+ span : c. source_info . span ,
886879 ty : fty,
887880 literal : Literal :: Item {
888881 def_id : free_func,
@@ -910,7 +903,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
910903 ty:: TyStruct ( def, _) | ty:: TyEnum ( def, _) => {
911904 if def. has_dtor ( ) {
912905 self . tcx . sess . span_warn (
913- c. span ,
906+ c. source_info . span ,
914907 & format ! ( "dataflow bug??? moving out of type with dtor {:?}" ,
915908 c) ) ;
916909 true
@@ -932,15 +925,15 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
932925
933926 fn set_drop_flag ( & mut self , loc : Location , path : MovePathIndex , val : DropFlagState ) {
934927 if let Some ( & flag) = self . drop_flags . get ( & path) {
935- let span = self . patch . context_for_location ( self . mir , loc) . 0 ;
928+ let span = self . patch . source_info_for_location ( self . mir , loc) . span ;
936929 let val = self . constant_bool ( span, val. value ( ) ) ;
937930 self . patch . add_assign ( loc, Lvalue :: Temp ( flag) , val) ;
938931 }
939932 }
940933
941934 fn drop_flags_on_init ( & mut self ) {
942935 let loc = Location { block : START_BLOCK , index : 0 } ;
943- let span = self . patch . context_for_location ( self . mir , loc) . 0 ;
936+ let span = self . patch . source_info_for_location ( self . mir , loc) . span ;
944937 let false_ = self . constant_bool ( span, false ) ;
945938 for flag in self . drop_flags . values ( ) {
946939 self . patch . add_assign ( loc, Lvalue :: Temp ( * flag) , false_. clone ( ) ) ;
0 commit comments