about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-01-26 17:41:36 +0000
committerbors <bors@rust-lang.org>2018-01-26 17:41:36 +0000
commitbacb5c58dfdde7c35e99b2b0d8171238cc33cf6c (patch)
treea4a44364f143350bb7262ca8e63612e2ee71f6ed /src/libsyntax/ext
parenta97cd17f5d71fb4ec362f4fbd79373a6e7ed7b82 (diff)
parenta06d333a148f6c620044a765f47497f1ed1e4dde (diff)
downloadrust-bacb5c58dfdde7c35e99b2b0d8171238cc33cf6c.tar.gz
rust-bacb5c58dfdde7c35e99b2b0d8171238cc33cf6c.zip
Auto merge of #47748 - alexcrichton:rollup, r=alexcrichton
Rollup of 19 pull requests

- Successful merges: #47415, #47437, #47439, #47453, #47460, #47502, #47529, #47600, #47607, #47618, #47626, #47656, #47668, #47696, #47701, #47705, #47710, #47711, #47719
- Failed merges: #47455, #47521
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/base.rs2
-rw-r--r--src/libsyntax/ext/expand.rs2
-rw-r--r--src/libsyntax/ext/source_util.rs5
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs6
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs4
5 files changed, 10 insertions, 9 deletions
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 612d8501fb2..025aa94ce06 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -786,7 +786,7 @@ impl<'a> ExtCtxt<'a> {
     ///   substitute; we never hit resolve/type-checking so the dummy
     ///   value doesn't have to match anything)
     pub fn span_fatal<S: Into<MultiSpan>>(&self, sp: S, msg: &str) -> ! {
-        panic!(self.parse_sess.span_diagnostic.span_fatal(sp, msg));
+        self.parse_sess.span_diagnostic.span_fatal(sp, msg).raise();
     }
 
     /// Emit `msg` attached to `sp`, without immediately stopping
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index 11988a8f89d..44a073545a7 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -455,7 +455,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
                 suggested_limit));
             err.emit();
             self.cx.trace_macros_diag();
-            panic!(FatalError);
+            FatalError.raise();
         }
 
         Some(result)
diff --git a/src/libsyntax/ext/source_util.rs b/src/libsyntax/ext/source_util.rs
index 6b08448107a..ec4e6ced1b2 100644
--- a/src/libsyntax/ext/source_util.rs
+++ b/src/libsyntax/ext/source_util.rs
@@ -116,9 +116,10 @@ pub fn expand_include<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[tokenstream::T
             while self.p.token != token::Eof {
                 match panictry!(self.p.parse_item()) {
                     Some(item) => ret.push(item),
-                    None => panic!(self.p.diagnostic().span_fatal(self.p.span,
+                    None => self.p.diagnostic().span_fatal(self.p.span,
                                                            &format!("expected item, found `{}`",
-                                                                    self.p.this_token_to_string())))
+                                                                    self.p.this_token_to_string()))
+                                               .raise()
                 }
             }
             Some(ret)
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 124477620c2..3e3c1618fff 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -573,7 +573,7 @@ fn parse_nt<'a>(p: &mut Parser<'a>, sp: Span, name: &str) -> Nonterminal {
             Some(i) => token::NtItem(i),
             None => {
                 p.fatal("expected an item keyword").emit();
-                panic!(FatalError);
+                FatalError.raise();
             }
         },
         "block" => token::NtBlock(panictry!(p.parse_block())),
@@ -581,7 +581,7 @@ fn parse_nt<'a>(p: &mut Parser<'a>, sp: Span, name: &str) -> Nonterminal {
             Some(s) => token::NtStmt(s),
             None => {
                 p.fatal("expected a statement").emit();
-                panic!(FatalError);
+                FatalError.raise();
             }
         },
         "pat" => token::NtPat(panictry!(p.parse_pat())),
@@ -597,7 +597,7 @@ fn parse_nt<'a>(p: &mut Parser<'a>, sp: Span, name: &str) -> Nonterminal {
                 let token_str = pprust::token_to_string(&p.token);
                 p.fatal(&format!("expected ident, found {}",
                                  &token_str[..])).emit();
-                panic!(FatalError)
+                FatalError.raise()
             }
         },
         "path" => token::NtPath(panictry!(p.parse_path_common(PathStyle::Type, false))),
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index d86603e94e9..9efb4faa635 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -222,10 +222,10 @@ pub fn compile(sess: &ParseSess, features: &RefCell<Features>, def: &ast::Item)
         Success(m) => m,
         Failure(sp, tok) => {
             let s = parse_failure_msg(tok);
-            panic!(sess.span_diagnostic.span_fatal(sp.substitute_dummy(def.span), &s));
+            sess.span_diagnostic.span_fatal(sp.substitute_dummy(def.span), &s).raise();
         }
         Error(sp, s) => {
-            panic!(sess.span_diagnostic.span_fatal(sp.substitute_dummy(def.span), &s));
+            sess.span_diagnostic.span_fatal(sp.substitute_dummy(def.span), &s).raise();
         }
     };