Some formatting cleanup
This commit is contained in:
parent
cd4b468e07
commit
9e777eb45d
2 changed files with 7 additions and 8 deletions
|
|
@ -2338,13 +2338,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
debug!("warn_if_unreachable: id={:?} span={:?} kind={}", id, span, kind);
|
||||
|
||||
let msg = format!("unreachable {}", kind);
|
||||
let mut err = self.tcx().struct_span_lint_hir(lint::builtin::UNREACHABLE_CODE,
|
||||
id, span, &msg);
|
||||
err.span_note(
|
||||
orig_span,
|
||||
custom_note.unwrap_or("any code following this expression is unreachable")
|
||||
);
|
||||
err.emit();
|
||||
self.tcx().struct_span_lint_hir(lint::builtin::UNREACHABLE_CODE, id, span, &msg)
|
||||
.span_note(
|
||||
orig_span,
|
||||
custom_note.unwrap_or("any code following this expression is unreachable")
|
||||
)
|
||||
.emit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// Tests that we generate nice error messages
|
||||
// when an expression is unreachble due to control
|
||||
// flow inside of a macro expansion
|
||||
// flow inside of a macro expansion.
|
||||
#![deny(unreachable_code)]
|
||||
|
||||
macro_rules! early_return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue