auto merge of #15431 : iliekturtles/rust/13279-error-msg-order, r=pcwalton
Moved note after error to reduce confusion when the pair appears in the middle of other errors. Closes #13279.
This commit is contained in:
commit
c8b2a3167b
2 changed files with 6 additions and 5 deletions
|
|
@ -1458,6 +1458,8 @@ impl<'a> Liveness<'a> {
|
|||
},
|
||||
_ => false
|
||||
};
|
||||
self.ir.tcx.sess.span_err(
|
||||
sp, "not all control paths return a value");
|
||||
if ends_with_stmt {
|
||||
let last_stmt = body.stmts.last().unwrap();
|
||||
let original_span = original_sp(last_stmt.span, sp);
|
||||
|
|
@ -1469,8 +1471,6 @@ impl<'a> Liveness<'a> {
|
|||
self.ir.tcx.sess.span_note(
|
||||
span_semicolon, "consider removing this semicolon:");
|
||||
}
|
||||
self.ir.tcx.sess.span_err(
|
||||
sp, "not all control paths return a value");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue