1
1
use rustc_middle:: mir:: visit:: Visitor ;
2
2
use rustc_middle:: mir:: { self , BasicBlock , Location } ;
3
- use rustc_middle:: ty:: TyCtxt ;
3
+ use rustc_middle:: ty:: { Ty , TyCtxt } ;
4
4
use rustc_span:: { symbol:: sym, Span } ;
5
5
6
6
use super :: check:: Qualifs ;
@@ -58,9 +58,9 @@ impl<'mir, 'tcx> std::ops::Deref for CheckLiveDrops<'mir, 'tcx> {
58
58
}
59
59
}
60
60
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 ( ) ;
64
64
}
65
65
}
66
66
@@ -90,7 +90,7 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {
90
90
}
91
91
92
92
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 ) ;
94
94
return ;
95
95
}
96
96
@@ -101,7 +101,7 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {
101
101
if self . qualifs . needs_non_const_drop ( self . ccx , dropped_place. local , location) {
102
102
// Use the span where the dropped local was declared for the error.
103
103
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 ) ;
105
105
}
106
106
}
107
107
0 commit comments