mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-11 07:21:51 +00:00
Add span label to E0381 for MIR borrowck
This commit is contained in:
parent
a6a7dac5cf
commit
1797a942b7
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user