Skip to content

Commit

Permalink
Add span label to E0381 for MIR borrowck
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Sep 23, 2017
1 parent a6a7dac commit 1797a94
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/librustc_mir/borrow_check.rs
Expand Up @@ -896,10 +896,13 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
fn report_use_of_moved(&mut self,
_context: Context,
(lvalue, span): (&Lvalue, Span)) {
let mut err = self.tcx.cannot_act_on_uninitialized_variable(
span, "use", &self.describe_lvalue(lvalue), Origin::Mir);
// FIXME: add span_label for use of uninitialized variable
err.emit();
self.tcx.cannot_act_on_uninitialized_variable(span,
"use",
&self.describe_lvalue(lvalue),
Origin::Mir)
.span_label(span, format!("use of possibly uninitialized `{}`",
self.describe_lvalue(lvalue)))
.emit();
}

fn report_move_out_while_borrowed(&mut self,
Expand Down

0 comments on commit 1797a94

Please sign in to comment.