about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-10-25 13:12:53 +0200
committerGitHub <noreply@github.com>2019-10-25 13:12:53 +0200
commit0bfe483c5c5c89d4ea6e703f06b05863ea8429fe (patch)
tree936d701f369667093db5db5926b401ac88b29aa6 /src
parent07b5c2a46ed224c3c84f715ecca2d942c275615f (diff)
parentd7f6ba83fcf59fb32f1017ddff310c56a1008b3a (diff)
downloadrust-0bfe483c5c5c89d4ea6e703f06b05863ea8429fe.tar.gz
rust-0bfe483c5c5c89d4ea6e703f06b05863ea8429fe.zip
Rollup merge of #65787 - Centril:panictry, r=davidtwco
move panictry! to where it is used.

From https://github.com/rust-lang/rust/pull/65324

r? @davidtwco
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax/lib.rs17
-rw-r--r--src/libsyntax/parse/mod.rs17
2 files changed, 17 insertions, 17 deletions
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 3fa13f08d3a..3a2af96f7db 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -31,23 +31,6 @@ mod tests;
 
 pub const MACRO_ARGUMENTS: Option<&'static str> = Some("macro arguments");
 
-// A variant of 'panictry!' that works on a Vec<Diagnostic> instead of a single DiagnosticBuilder.
-macro_rules! panictry_buffer {
-    ($handler:expr, $e:expr) => ({
-        use std::result::Result::{Ok, Err};
-        use errors::FatalError;
-        match $e {
-            Ok(e) => e,
-            Err(errs) => {
-                for e in errs {
-                    $handler.emit_diagnostic(&e);
-                }
-                FatalError.raise()
-            }
-        }
-    })
-}
-
 #[macro_export]
 macro_rules! unwrap_or {
     ($opt:expr, $default:expr) => {
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs
index e6b794a6a99..e6ddf8778cc 100644
--- a/src/libsyntax/parse/mod.rs
+++ b/src/libsyntax/parse/mod.rs
@@ -59,6 +59,23 @@ pub enum DirectoryOwnership {
 // uses a HOF to parse anything, and <source> includes file and
 // `source_str`.
 
+/// A variant of 'panictry!' that works on a Vec<Diagnostic> instead of a single DiagnosticBuilder.
+macro_rules! panictry_buffer {
+    ($handler:expr, $e:expr) => ({
+        use std::result::Result::{Ok, Err};
+        use errors::FatalError;
+        match $e {
+            Ok(e) => e,
+            Err(errs) => {
+                for e in errs {
+                    $handler.emit_diagnostic(&e);
+                }
+                FatalError.raise()
+            }
+        }
+    })
+}
+
 pub fn parse_crate_from_file<'a>(input: &Path, sess: &'a ParseSess) -> PResult<'a, ast::Crate> {
     let mut parser = new_parser_from_file(sess, input);
     parser.parse_crate_mod()