Some formatting cleanup

This commit is contained in:
Aaron Hill 2019-09-18 19:31:38 -04:00
parent cd4b468e07
commit 9e777eb45d
No known key found for this signature in database
GPG key ID: B4087E510E98B164
2 changed files with 7 additions and 8 deletions

View file

@ -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();
}
}
}

View file

@ -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 {