Skip to content

Commit 0bfe483

Browse files
authored
Rollup merge of #65787 - Centril:panictry, r=davidtwco
move panictry! to where it is used. From #65324 r? @davidtwco
2 parents 07b5c2a + d7f6ba8 commit 0bfe483

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/libsyntax/lib.rs

-17
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,6 @@ mod tests;
3131

3232
pub const MACRO_ARGUMENTS: Option<&'static str> = Some("macro arguments");
3333

34-
// A variant of 'panictry!' that works on a Vec<Diagnostic> instead of a single DiagnosticBuilder.
35-
macro_rules! panictry_buffer {
36-
($handler:expr, $e:expr) => ({
37-
use std::result::Result::{Ok, Err};
38-
use errors::FatalError;
39-
match $e {
40-
Ok(e) => e,
41-
Err(errs) => {
42-
for e in errs {
43-
$handler.emit_diagnostic(&e);
44-
}
45-
FatalError.raise()
46-
}
47-
}
48-
})
49-
}
50-
5134
#[macro_export]
5235
macro_rules! unwrap_or {
5336
($opt:expr, $default:expr) => {

src/libsyntax/parse/mod.rs

+17
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ pub enum DirectoryOwnership {
5959
// uses a HOF to parse anything, and <source> includes file and
6060
// `source_str`.
6161

62+
/// A variant of 'panictry!' that works on a Vec<Diagnostic> instead of a single DiagnosticBuilder.
63+
macro_rules! panictry_buffer {
64+
($handler:expr, $e:expr) => ({
65+
use std::result::Result::{Ok, Err};
66+
use errors::FatalError;
67+
match $e {
68+
Ok(e) => e,
69+
Err(errs) => {
70+
for e in errs {
71+
$handler.emit_diagnostic(&e);
72+
}
73+
FatalError.raise()
74+
}
75+
}
76+
})
77+
}
78+
6279
pub fn parse_crate_from_file<'a>(input: &Path, sess: &'a ParseSess) -> PResult<'a, ast::Crate> {
6380
let mut parser = new_parser_from_file(sess, input);
6481
parser.parse_crate_mod()

0 commit comments

Comments
 (0)