mir is already a reference

This commit is contained in:
Santiago Pastorino 2018-03-05 14:34:24 -03:00
parent c85c5a0423
commit 4b12ded889
No known key found for this signature in database
GPG Key ID: 88C941CDA1D46432

View File

@ -40,7 +40,7 @@ pub(in borrow_check) fn explain_why_borrow_contains_point(
if let Some(cause) = cause_info.why_region_contains_point(borrow.region, context.loc) {
match *cause.root_cause() {
Cause::LiveVar(local, location) => {
match find_regular_use(&mir, regioncx, borrow, location, local) {
match find_regular_use(mir, regioncx, borrow, location, local) {
Some(p) => {
err.span_label(
mir.source_info(p).span,
@ -58,9 +58,9 @@ pub(in borrow_check) fn explain_why_borrow_contains_point(
}
Cause::DropVar(local, location) => {
match find_drop_use(&mir, regioncx, borrow, location, local) {
match find_drop_use(mir, regioncx, borrow, location, local) {
Some(p) => {
let local_name = &mir.local_decls[local].name.unwrap();
let local_name = mir.local_decls[local].name.unwrap();
err.span_label(
mir.source_info(p).span,