11use rustc_middle:: mir:: visit:: Visitor ;
22use rustc_middle:: mir:: { self , BasicBlock , Location } ;
3- use rustc_middle:: ty:: TyCtxt ;
3+ use rustc_middle:: ty:: { Ty , TyCtxt } ;
44use rustc_span:: { symbol:: sym, Span } ;
55
66use super :: check:: Qualifs ;
@@ -58,9 +58,9 @@ impl<'mir, 'tcx> std::ops::Deref for CheckLiveDrops<'mir, 'tcx> {
5858 }
5959}
6060
61- impl CheckLiveDrops < ' _ , ' _ > {
62- fn check_live_drop ( & self , span : Span ) {
63- ops:: LiveDrop { dropped_at : None } . build_error ( self . ccx , span) . emit ( ) ;
61+ impl < ' tcx > CheckLiveDrops < ' _ , ' tcx > {
62+ fn check_live_drop ( & self , span : Span , dropped_ty : Ty < ' tcx > ) {
63+ ops:: LiveDrop { dropped_at : None , dropped_ty } . build_error ( self . ccx , span) . emit ( ) ;
6464 }
6565}
6666
@@ -90,7 +90,7 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {
9090 }
9191
9292 if dropped_place. is_indirect ( ) {
93- self . check_live_drop ( terminator. source_info . span ) ;
93+ self . check_live_drop ( terminator. source_info . span , dropped_ty ) ;
9494 return ;
9595 }
9696
@@ -101,7 +101,7 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {
101101 if self . qualifs . needs_non_const_drop ( self . ccx , dropped_place. local , location) {
102102 // Use the span where the dropped local was declared for the error.
103103 let span = self . body . local_decls [ dropped_place. local ] . source_info . span ;
104- self . check_live_drop ( span) ;
104+ self . check_live_drop ( span, dropped_ty ) ;
105105 }
106106 }
107107
0 commit comments