File tree Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Expand file tree Collapse file tree 2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -31,23 +31,6 @@ mod tests;
3131
3232pub 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]
5235macro_rules! unwrap_or {
5336 ( $opt: expr, $default: expr) => {
Original file line number Diff line number Diff 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+
6279pub 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 ( )
You can’t perform that action at this time.
0 commit comments