Skip to content

Commit

Permalink
tidy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gaurikholkar committed Apr 6, 2018
1 parent e6938ee commit 6686d10
Showing 1 changed file with 1 addition and 34 deletions.
35 changes: 1 addition & 34 deletions src/librustc_mir/borrow_check/mod.rs
Expand Up @@ -1592,43 +1592,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
},
_ => {},
}
},
},
_ => {},
}


// match *place_err {
// Place::Projection(ref proj) => {
// match proj.elem {
// ProjectionElem::Deref => {
// match proj.base {
// Place::Local(local) => {
// let locations = self.mir.find_assignments(local);
// if locations.len() > 0 {
// let item_msg = if error_reported {
// match self.specialized_description(base){
// Some(msg) => msg,
// None => self.get_main_error_message(place)
// }
// } else {
// self.get_main_error_message(place)
// };
// err_info = Some((
// self.mir.source_info(locations[0]).span,
// "consider changing this to be a \
// mutable reference: `&mut`", item_msg,
// "cannot assign through `&`-reference"));
// }
// }
// _ => {},
// }
// }
// _ => {}
// }
// }
// _ => {}
// }

if let Some((err_help_span, err_help_stmt, item_msg, sec_span)) = err_info {
let mut err = self.tcx.cannot_assign(span, &item_msg, Origin::Mir, true);
err.span_suggestion(err_help_span, err_help_stmt, format!(""));
Expand Down

0 comments on commit 6686d10

Please sign in to comment.