Skip to content

Commit f635ce5

Browse files
authored
Rollup merge of rust-lang#63308 - spastorino:place-ref-base-is-ref, r=oli-obk
PlaceRef's base is already a reference r? @oli-obk
2 parents 3c76ab3 + f85fc71 commit f635ce5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/librustc_mir/borrow_check/error_reporting.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
177177
buf.push_str(&self.infcx.tcx.item_name(*def_id).to_string());
178178
}
179179
PlaceRef {
180-
ref base,
180+
base,
181181
projection: Some(ref proj),
182182
} => {
183183
match proj.elem {
@@ -197,7 +197,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
197197
// FIXME turn this recursion into iteration
198198
self.append_place_to_string(
199199
PlaceRef {
200-
base: &base,
200+
base,
201201
projection: &proj.base,
202202
},
203203
buf,
@@ -210,7 +210,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
210210
if self.body.local_decls[*local].is_ref_for_guard() {
211211
self.append_place_to_string(
212212
PlaceRef {
213-
base: &base,
213+
base,
214214
projection: &proj.base,
215215
},
216216
buf,
@@ -222,7 +222,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
222222
buf.push_str(&"*");
223223
self.append_place_to_string(
224224
PlaceRef {
225-
base: &base,
225+
base,
226226
projection: &proj.base,
227227
},
228228
buf,
@@ -236,7 +236,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
236236
buf.push_str(&"*");
237237
self.append_place_to_string(
238238
PlaceRef {
239-
base: &base,
239+
base,
240240
projection: &proj.base,
241241
},
242242
buf,
@@ -251,7 +251,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
251251
ProjectionElem::Downcast(..) => {
252252
self.append_place_to_string(
253253
PlaceRef {
254-
base: &base,
254+
base,
255255
projection: &proj.base,
256256
},
257257
buf,
@@ -273,12 +273,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
273273
buf.push_str(&name);
274274
} else {
275275
let field_name = self.describe_field(PlaceRef {
276-
base: base,
276+
base,
277277
projection: &proj.base,
278278
}, field);
279279
self.append_place_to_string(
280280
PlaceRef {
281-
base: &base,
281+
base,
282282
projection: &proj.base,
283283
},
284284
buf,
@@ -293,7 +293,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
293293

294294
self.append_place_to_string(
295295
PlaceRef {
296-
base: &base,
296+
base,
297297
projection: &proj.base,
298298
},
299299
buf,
@@ -313,7 +313,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
313313
// to avoid confusing the end-user
314314
self.append_place_to_string(
315315
PlaceRef {
316-
base: &base,
316+
base,
317317
projection: &proj.base,
318318
},
319319
buf,

0 commit comments

Comments
 (0)