@@ -56,33 +56,33 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
56
56
fn visit_statement ( & mut self , statement : & Statement < ' tcx > , location : Location ) {
57
57
self . check_activations ( location) ;
58
58
59
- match statement. kind {
60
- StatementKind :: Assign ( box ( ref lhs, ref rhs) ) => {
59
+ match & statement. kind {
60
+ StatementKind :: Assign ( box ( lhs, rhs) ) => {
61
61
self . consume_rvalue ( location, rhs) ;
62
62
63
- self . mutate_place ( location, lhs, Shallow ( None ) , JustWrite ) ;
63
+ self . mutate_place ( location, * lhs, Shallow ( None ) , JustWrite ) ;
64
64
}
65
65
StatementKind :: FakeRead ( _, _) => {
66
66
// Only relevant for initialized/liveness/safety checks.
67
67
}
68
- StatementKind :: SetDiscriminant { ref place, variant_index : _ } => {
69
- self . mutate_place ( location, place, Shallow ( None ) , JustWrite ) ;
68
+ StatementKind :: SetDiscriminant { place, variant_index : _ } => {
69
+ self . mutate_place ( location, * * place, Shallow ( None ) , JustWrite ) ;
70
70
}
71
- StatementKind :: LlvmInlineAsm ( ref asm) => {
71
+ StatementKind :: LlvmInlineAsm ( asm) => {
72
72
for ( o, output) in asm. asm . outputs . iter ( ) . zip ( asm. outputs . iter ( ) ) {
73
73
if o. is_indirect {
74
74
// FIXME(eddyb) indirect inline asm outputs should
75
75
// be encoded through MIR place derefs instead.
76
76
self . access_place (
77
77
location,
78
- output,
78
+ * output,
79
79
( Deep , Read ( ReadKind :: Copy ) ) ,
80
80
LocalMutationIsAllowed :: No ,
81
81
) ;
82
82
} else {
83
83
self . mutate_place (
84
84
location,
85
- output,
85
+ * output,
86
86
if o. is_rw { Deep } else { Shallow ( None ) } ,
87
87
if o. is_rw { WriteAndRead } else { JustWrite } ,
88
88
) ;
@@ -102,7 +102,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
102
102
StatementKind :: StorageDead ( local) => {
103
103
self . access_place (
104
104
location,
105
- & Place :: from ( local) ,
105
+ Place :: from ( * local) ,
106
106
( Shallow ( None ) , Write ( WriteKind :: StorageDeadOrDrop ) ) ,
107
107
LocalMutationIsAllowed :: Yes ,
108
108
) ;
@@ -119,36 +119,36 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
119
119
TerminatorKind :: SwitchInt { ref discr, switch_ty : _, values : _, targets : _ } => {
120
120
self . consume_operand ( location, discr) ;
121
121
}
122
- TerminatorKind :: Drop { location : ref drop_place, target : _, unwind : _ } => {
122
+ TerminatorKind :: Drop { location : drop_place, target : _, unwind : _ } => {
123
123
self . access_place (
124
124
location,
125
- drop_place,
125
+ * drop_place,
126
126
( AccessDepth :: Drop , Write ( WriteKind :: StorageDeadOrDrop ) ) ,
127
127
LocalMutationIsAllowed :: Yes ,
128
128
) ;
129
129
}
130
130
TerminatorKind :: DropAndReplace {
131
- location : ref drop_place,
131
+ location : drop_place,
132
132
value : ref new_value,
133
133
target : _,
134
134
unwind : _,
135
135
} => {
136
- self . mutate_place ( location, drop_place, Deep , JustWrite ) ;
136
+ self . mutate_place ( location, * drop_place, Deep , JustWrite ) ;
137
137
self . consume_operand ( location, new_value) ;
138
138
}
139
139
TerminatorKind :: Call {
140
140
ref func,
141
141
ref args,
142
- ref destination,
142
+ destination,
143
143
cleanup : _,
144
144
from_hir_call : _,
145
145
} => {
146
146
self . consume_operand ( location, func) ;
147
147
for arg in args {
148
148
self . consume_operand ( location, arg) ;
149
149
}
150
- if let Some ( ( ref dest, _ /*bb*/ ) ) = * destination {
151
- self . mutate_place ( location, dest, Deep , JustWrite ) ;
150
+ if let Some ( ( dest, _ /*bb*/ ) ) = destination {
151
+ self . mutate_place ( location, * dest, Deep , JustWrite ) ;
152
152
}
153
153
}
154
154
TerminatorKind :: Assert { ref cond, expected : _, ref msg, target : _, cleanup : _ } => {
@@ -171,7 +171,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
171
171
}
172
172
}
173
173
174
- self . mutate_place ( location, resume_arg, Deep , JustWrite ) ;
174
+ self . mutate_place ( location, * resume_arg, Deep , JustWrite ) ;
175
175
}
176
176
TerminatorKind :: Resume | TerminatorKind :: Return | TerminatorKind :: GeneratorDrop => {
177
177
// Invalidate all borrows of local places
@@ -201,7 +201,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
201
201
fn mutate_place (
202
202
& mut self ,
203
203
location : Location ,
204
- place : & Place < ' tcx > ,
204
+ place : Place < ' tcx > ,
205
205
kind : AccessDepth ,
206
206
_mode : MutateMode ,
207
207
) {
@@ -216,15 +216,15 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
216
216
/// Simulates consumption of an operand.
217
217
fn consume_operand ( & mut self , location : Location , operand : & Operand < ' tcx > ) {
218
218
match * operand {
219
- Operand :: Copy ( ref place) => {
219
+ Operand :: Copy ( place) => {
220
220
self . access_place (
221
221
location,
222
222
place,
223
223
( Deep , Read ( ReadKind :: Copy ) ) ,
224
224
LocalMutationIsAllowed :: No ,
225
225
) ;
226
226
}
227
- Operand :: Move ( ref place) => {
227
+ Operand :: Move ( place) => {
228
228
self . access_place (
229
229
location,
230
230
place,
@@ -239,7 +239,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
239
239
// Simulates consumption of an rvalue
240
240
fn consume_rvalue ( & mut self , location : Location , rvalue : & Rvalue < ' tcx > ) {
241
241
match * rvalue {
242
- Rvalue :: Ref ( _ /*rgn*/ , bk, ref place) => {
242
+ Rvalue :: Ref ( _ /*rgn*/ , bk, place) => {
243
243
let access_kind = match bk {
244
244
BorrowKind :: Shallow => {
245
245
( Shallow ( Some ( ArtificialField :: ShallowBorrow ) ) , Read ( ReadKind :: Borrow ( bk) ) )
@@ -258,7 +258,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
258
258
self . access_place ( location, place, access_kind, LocalMutationIsAllowed :: No ) ;
259
259
}
260
260
261
- Rvalue :: AddressOf ( mutability, ref place) => {
261
+ Rvalue :: AddressOf ( mutability, place) => {
262
262
let access_kind = match mutability {
263
263
Mutability :: Mut => (
264
264
Deep ,
@@ -279,7 +279,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
279
279
self . consume_operand ( location, operand)
280
280
}
281
281
282
- Rvalue :: Len ( ref place) | Rvalue :: Discriminant ( ref place) => {
282
+ Rvalue :: Len ( place) | Rvalue :: Discriminant ( place) => {
283
283
let af = match * rvalue {
284
284
Rvalue :: Len ( ..) => Some ( ArtificialField :: ArrayLength ) ,
285
285
Rvalue :: Discriminant ( ..) => None ,
@@ -313,7 +313,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
313
313
fn access_place (
314
314
& mut self ,
315
315
location : Location ,
316
- place : & Place < ' tcx > ,
316
+ place : Place < ' tcx > ,
317
317
kind : ( AccessDepth , ReadOrWrite ) ,
318
318
_is_local_mutation_allowed : LocalMutationIsAllowed ,
319
319
) {
@@ -325,7 +325,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
325
325
fn check_access_for_conflict (
326
326
& mut self ,
327
327
location : Location ,
328
- place : & Place < ' tcx > ,
328
+ place : Place < ' tcx > ,
329
329
sd : AccessDepth ,
330
330
rw : ReadOrWrite ,
331
331
) {
@@ -413,7 +413,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
413
413
414
414
self . access_place (
415
415
location,
416
- & borrow. borrowed_place ,
416
+ borrow. borrowed_place ,
417
417
( Deep , Activation ( WriteKind :: MutableBorrow ( borrow. kind ) , borrow_index) ) ,
418
418
LocalMutationIsAllowed :: No ,
419
419
) ;
0 commit comments