@@ -15,7 +15,7 @@ pub struct AddRetag;
15
15
/// (Concurrent accesses by other threads are no problem as these are anyway non-atomic
16
16
/// copies. Data races are UB.)
17
17
fn is_stable (
18
- place : & Place < ' _ > ,
18
+ place : PlaceRef < ' _ , ' _ > ,
19
19
) -> bool {
20
20
if let Some ( proj) = & place. projection {
21
21
match proj. elem {
@@ -32,9 +32,9 @@ fn is_stable(
32
32
ProjectionElem :: ConstantIndex { .. } |
33
33
ProjectionElem :: Subslice { .. } |
34
34
ProjectionElem :: Downcast { .. } =>
35
- is_stable ( & Place {
36
- base : place. base . clone ( ) ,
37
- projection : proj. base . clone ( ) ,
35
+ is_stable ( PlaceRef {
36
+ base : place. base ,
37
+ projection : & proj. base ,
38
38
} ) ,
39
39
}
40
40
} else {
@@ -79,7 +79,8 @@ impl MirPass for AddRetag {
79
79
let needs_retag = |place : & Place < ' tcx > | {
80
80
// FIXME: Instead of giving up for unstable places, we should introduce
81
81
// a temporary and retag on that.
82
- is_stable ( place) && may_have_reference ( place. ty ( & * local_decls, tcx) . ty , tcx)
82
+ is_stable ( place. as_place_ref ( ) )
83
+ && may_have_reference ( place. ty ( & * local_decls, tcx) . ty , tcx)
83
84
} ;
84
85
85
86
// PART 1
0 commit comments