diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-12-15 17:12:30 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2020-02-06 21:32:07 +0200 |
| commit | f6fc80206e9600ae753cdfbd762fb982afca48b0 (patch) | |
| tree | 91bdbf8d40248f5ecc5fa5ea6d66e4c91ece1128 /src/librustc_errors | |
| parent | 8f286dbf27b61afdd96f632d0bc7f4c49fbb7d0f (diff) | |
| download | rust-f6fc80206e9600ae753cdfbd762fb982afca48b0.tar.gz rust-f6fc80206e9600ae753cdfbd762fb982afca48b0.zip | |
rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.
Diffstat (limited to 'src/librustc_errors')
| -rw-r--r-- | src/librustc_errors/annotate_snippet_emitter_writer.rs | 8 | ||||
| -rw-r--r-- | src/librustc_errors/emitter.rs | 28 | ||||
| -rw-r--r-- | src/librustc_errors/json.rs | 22 | ||||
| -rw-r--r-- | src/librustc_errors/lib.rs | 8 |
4 files changed, 26 insertions, 40 deletions
diff --git a/src/librustc_errors/annotate_snippet_emitter_writer.rs b/src/librustc_errors/annotate_snippet_emitter_writer.rs index 65d82f545e8..1eda1c9200f 100644 --- a/src/librustc_errors/annotate_snippet_emitter_writer.rs +++ b/src/librustc_errors/annotate_snippet_emitter_writer.rs @@ -23,7 +23,7 @@ pub struct AnnotateSnippetEmitterWriter { /// If true, will normalize line numbers with `LL` to prevent noise in UI test diffs. ui_testing: bool, - external_macro_backtrace: bool, + macro_backtrace: bool, } impl Emitter for AnnotateSnippetEmitterWriter { @@ -37,7 +37,7 @@ impl Emitter for AnnotateSnippetEmitterWriter { &mut primary_span, &mut children, &diag.level, - self.external_macro_backtrace, + self.macro_backtrace, ); self.emit_messages_default( @@ -172,9 +172,9 @@ impl AnnotateSnippetEmitterWriter { pub fn new( source_map: Option<Lrc<SourceMap>>, short_message: bool, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> Self { - Self { source_map, short_message, ui_testing: false, external_macro_backtrace } + Self { source_map, short_message, ui_testing: false, macro_backtrace } } /// Allows to modify `Self` to enable or disable the `ui_testing` flag. diff --git a/src/librustc_errors/emitter.rs b/src/librustc_errors/emitter.rs index d32b8c689dc..59493b4a683 100644 --- a/src/librustc_errors/emitter.rs +++ b/src/librustc_errors/emitter.rs @@ -54,19 +54,11 @@ impl HumanReadableErrorType { source_map: Option<Lrc<SourceMap>>, teach: bool, terminal_width: Option<usize>, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> EmitterWriter { let (short, color_config) = self.unzip(); let color = color_config.suggests_using_colors(); - EmitterWriter::new( - dst, - source_map, - short, - teach, - color, - terminal_width, - external_macro_backtrace, - ) + EmitterWriter::new(dst, source_map, short, teach, color, terminal_width, macro_backtrace) } } @@ -294,12 +286,12 @@ pub trait Emitter { if self.fix_multispans_in_extern_macros(source_map, span, children) { let msg = if level == &Error { "this error originates in a macro outside of the current crate \ - (in Nightly builds, run with -Z external-macro-backtrace \ + (in Nightly builds, run with -Z macro-backtrace \ for more info)" .to_string() } else { "this warning originates in a macro outside of the current crate \ - (in Nightly builds, run with -Z external-macro-backtrace \ + (in Nightly builds, run with -Z macro-backtrace \ for more info)" .to_string() }; @@ -467,7 +459,7 @@ impl Emitter for EmitterWriter { &mut primary_span, &mut children, &diag.level, - self.external_macro_backtrace, + self.macro_backtrace, ); self.emit_messages_default( @@ -546,7 +538,7 @@ pub struct EmitterWriter { ui_testing: bool, terminal_width: Option<usize>, - external_macro_backtrace: bool, + macro_backtrace: bool, } #[derive(Debug)] @@ -563,7 +555,7 @@ impl EmitterWriter { short_message: bool, teach: bool, terminal_width: Option<usize>, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> EmitterWriter { let dst = Destination::from_stderr(color_config); EmitterWriter { @@ -573,7 +565,7 @@ impl EmitterWriter { teach, ui_testing: false, terminal_width, - external_macro_backtrace, + macro_backtrace, } } @@ -584,7 +576,7 @@ impl EmitterWriter { teach: bool, colored: bool, terminal_width: Option<usize>, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> EmitterWriter { EmitterWriter { dst: Raw(dst, colored), @@ -593,7 +585,7 @@ impl EmitterWriter { teach, ui_testing: false, terminal_width, - external_macro_backtrace, + macro_backtrace, } } diff --git a/src/librustc_errors/json.rs b/src/librustc_errors/json.rs index 3ddf9b09893..ffdff6acec5 100644 --- a/src/librustc_errors/json.rs +++ b/src/librustc_errors/json.rs @@ -36,7 +36,7 @@ pub struct JsonEmitter { pretty: bool, ui_testing: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, } impl JsonEmitter { @@ -45,7 +45,7 @@ impl JsonEmitter { source_map: Lrc<SourceMap>, pretty: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> JsonEmitter { JsonEmitter { dst: Box::new(io::stderr()), @@ -54,14 +54,14 @@ impl JsonEmitter { pretty, ui_testing: false, json_rendered, - external_macro_backtrace, + macro_backtrace, } } pub fn basic( pretty: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> JsonEmitter { let file_path_mapping = FilePathMapping::empty(); JsonEmitter::stderr( @@ -69,7 +69,7 @@ impl JsonEmitter { Lrc::new(SourceMap::new(file_path_mapping)), pretty, json_rendered, - external_macro_backtrace, + macro_backtrace, ) } @@ -79,7 +79,7 @@ impl JsonEmitter { source_map: Lrc<SourceMap>, pretty: bool, json_rendered: HumanReadableErrorType, - external_macro_backtrace: bool, + macro_backtrace: bool, ) -> JsonEmitter { JsonEmitter { dst, @@ -88,7 +88,7 @@ impl JsonEmitter { pretty, ui_testing: false, json_rendered, - external_macro_backtrace, + macro_backtrace, } } @@ -245,13 +245,7 @@ impl Diagnostic { let buf = BufWriter::default(); let output = buf.clone(); je.json_rendered - .new_emitter( - Box::new(buf), - Some(je.sm.clone()), - false, - None, - je.external_macro_backtrace, - ) + .new_emitter(Box::new(buf), Some(je.sm.clone()), false, None, je.macro_backtrace) .ui_testing(je.ui_testing) .emit_diagnostic(diag); let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap(); diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 17b293401f8..97667febc3c 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -336,9 +336,9 @@ pub struct HandlerFlags { /// If true, immediately print bugs registered with `delay_span_bug`. /// (rustc: see `-Z report-delayed-bugs`) pub report_delayed_bugs: bool, - /// show macro backtraces even for non-local macros. - /// (rustc: see `-Z external-macro-backtrace`) - pub external_macro_backtrace: bool, + /// Show macro backtraces. + /// (rustc: see `-Z macro-backtrace`) + pub macro_backtrace: bool, /// If true, identical diagnostics are reported only once. pub deduplicate_diagnostics: bool, } @@ -385,7 +385,7 @@ impl Handler { false, false, None, - flags.external_macro_backtrace, + flags.macro_backtrace, )); Self::with_emitter_and_flags(emitter, flags) } |
