about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2019-09-18 19:31:38 -0400
committerAaron Hill <aa1ronham@gmail.com>2019-09-18 19:31:38 -0400
commit9e777eb45de2bf972bbf7f2075fa491e22d2d071 (patch)
tree5f45725ee1fdd5a808de13a1f594fcc97b30b4d9 /src
parentcd4b468e07ab27eef87aa8757220d6439defc699 (diff)
downloadrust-9e777eb45de2bf972bbf7f2075fa491e22d2d071.tar.gz
rust-9e777eb45de2bf972bbf7f2075fa491e22d2d071.zip
Some formatting cleanup
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/mod.rs13
-rw-r--r--src/test/ui/reachable/expr_return_in_macro.rs2
2 files changed, 7 insertions, 8 deletions
diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs
index c44648bb9df..f6f3173e81c 100644
--- a/src/librustc_typeck/check/mod.rs
+++ b/src/librustc_typeck/check/mod.rs
@@ -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();
             }
         }
     }
diff --git a/src/test/ui/reachable/expr_return_in_macro.rs b/src/test/ui/reachable/expr_return_in_macro.rs
index 198ede6b141..4e57618bf5e 100644
--- a/src/test/ui/reachable/expr_return_in_macro.rs
+++ b/src/test/ui/reachable/expr_return_in_macro.rs
@@ -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 {