From 9a8d6b8bb5dd7dd2d378849f0c2fa586e3a5b48b Mon Sep 17 00:00:00 2001 From: John Kåre Alsaker Date: Sun, 21 Jan 2018 12:47:58 +0100 Subject: Do not capture stderr in the compiler. Instead just panic silently for fatal errors --- src/libsyntax_ext/deriving/custom.rs | 6 +++--- src/libsyntax_ext/proc_macro_impl.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libsyntax_ext') diff --git a/src/libsyntax_ext/deriving/custom.rs b/src/libsyntax_ext/deriving/custom.rs index f375847e705..22e78e9b426 100644 --- a/src/libsyntax_ext/deriving/custom.rs +++ b/src/libsyntax_ext/deriving/custom.rs @@ -92,7 +92,7 @@ impl MultiItemModifier for ProcMacroDerive { } err.emit(); - panic!(FatalError); + FatalError.raise(); } }; @@ -103,13 +103,13 @@ impl MultiItemModifier for ProcMacroDerive { // fail if there have been errors emitted Ok(_) if ecx.parse_sess.span_diagnostic.err_count() > error_count_before => { ecx.struct_span_fatal(span, msg).emit(); - panic!(FatalError); + FatalError.raise(); } Ok(new_items) => new_items.into_iter().map(Annotatable::Item).collect(), Err(_) => { // FIXME: handle this better ecx.struct_span_fatal(span, msg).emit(); - panic!(FatalError); + FatalError.raise(); } } }) diff --git a/src/libsyntax_ext/proc_macro_impl.rs b/src/libsyntax_ext/proc_macro_impl.rs index 5fcedbf50c6..12400e363f4 100644 --- a/src/libsyntax_ext/proc_macro_impl.rs +++ b/src/libsyntax_ext/proc_macro_impl.rs @@ -51,7 +51,7 @@ impl base::AttrProcMacro for AttrProcMacro { } err.emit(); - panic!(FatalError); + FatalError.raise(); } } } @@ -86,7 +86,7 @@ impl base::ProcMacro for BangProcMacro { } err.emit(); - panic!(FatalError); + FatalError.raise(); } } } -- cgit 1.4.1-3-g733a5