Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
PlaceRef's base is already a reference
  • Loading branch information
spastorino committed Aug 5, 2019
1 parent f6ecdc2 commit f85fc71
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/librustc_mir/borrow_check/error_reporting.rs
Expand Up @@ -177,7 +177,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
buf.push_str(&self.infcx.tcx.item_name(*def_id).to_string());
}
PlaceRef {
ref base,
base,
projection: Some(ref proj),
} => {
match proj.elem {
Expand All @@ -197,7 +197,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
// FIXME turn this recursion into iteration
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -210,7 +210,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
if self.body.local_decls[*local].is_ref_for_guard() {
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -222,7 +222,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
buf.push_str(&"*");
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -236,7 +236,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
buf.push_str(&"*");
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -251,7 +251,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
ProjectionElem::Downcast(..) => {
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -273,12 +273,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
buf.push_str(&name);
} else {
let field_name = self.describe_field(PlaceRef {
base: base,
base,
projection: &proj.base,
}, field);
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -293,7 +293,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {

self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand All @@ -313,7 +313,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
// to avoid confusing the end-user
self.append_place_to_string(
PlaceRef {
base: &base,
base,
projection: &proj.base,
},
buf,
Expand Down

0 comments on commit f85fc71

Please sign in to comment.