@@ -293,14 +293,11 @@ impl<'a, 'tcx> Qualifier<'a, 'tcx, 'tcx> {
293
293
debug ! ( "store to var {:?}" , index) ;
294
294
self . local_qualif [ index] = Some ( self . qualif ) ;
295
295
}
296
- Place :: Local ( index) if self . mir . local_kind ( index) == LocalKind :: Temp => {
297
- debug ! ( "store to temp {:?}" , index) ;
296
+ Place :: Local ( index) if self . mir . local_kind ( index) == LocalKind :: Temp ||
297
+ self . mir . local_kind ( index) == LocalKind :: ReturnPointer => {
298
+ debug ! ( "store to {:?} (temp or return pointer)" , index) ;
298
299
store ( & mut self . local_qualif [ index] )
299
300
}
300
- Place :: Local ( index) if self . mir . local_kind ( index) == LocalKind :: ReturnPointer => {
301
- debug ! ( "store to return place {:?}" , index) ;
302
- store ( & mut self . local_qualif [ RETURN_PLACE ] )
303
- }
304
301
305
302
Place :: Projection ( box Projection {
306
303
base : Place :: Local ( index) ,
@@ -772,7 +769,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
772
769
}
773
770
if let Place :: Local ( local) = * place {
774
771
if self . mir . local_kind ( local) == LocalKind :: Temp {
775
- if let Some ( qualif) = self . temp_qualif [ local] {
772
+ if let Some ( qualif) = self . local_qualif [ local] {
776
773
// `forbidden_mut` is false, so we can safely ignore
777
774
// `MUTABLE_INTERIOR` from the local's qualifications.
778
775
// This allows borrowing fields which don't have
0 commit comments