Skip to content

Commit 9e777eb

Browse files
committed
Some formatting cleanup
1 parent cd4b468 commit 9e777eb

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/librustc_typeck/check/mod.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,13 +2338,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
23382338
debug!("warn_if_unreachable: id={:?} span={:?} kind={}", id, span, kind);
23392339

23402340
let msg = format!("unreachable {}", kind);
2341-
let mut err = self.tcx().struct_span_lint_hir(lint::builtin::UNREACHABLE_CODE,
2342-
id, span, &msg);
2343-
err.span_note(
2344-
orig_span,
2345-
custom_note.unwrap_or("any code following this expression is unreachable")
2346-
);
2347-
err.emit();
2341+
self.tcx().struct_span_lint_hir(lint::builtin::UNREACHABLE_CODE, id, span, &msg)
2342+
.span_note(
2343+
orig_span,
2344+
custom_note.unwrap_or("any code following this expression is unreachable")
2345+
)
2346+
.emit();
23482347
}
23492348
}
23502349
}

src/test/ui/reachable/expr_return_in_macro.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Tests that we generate nice error messages
22
// when an expression is unreachble due to control
3-
// flow inside of a macro expansion
3+
// flow inside of a macro expansion.
44
#![deny(unreachable_code)]
55

66
macro_rules! early_return {

0 commit comments

Comments
 (0)