Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename -Zexternal-macro-backtrace to -Zmacro-backtrace and clean up implementation. #67359

Merged
merged 6 commits into from
Feb 7, 2020
Merged
8 changes: 7 additions & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,13 @@ impl<'a> Builder<'a> {
rustflags.arg("-Zforce-unstable-if-unmarked");
}

rustflags.arg("-Zexternal-macro-backtrace");
// cfg(bootstrap): the flag was renamed from `-Zexternal-macro-backtrace`
// to `-Zmacro-backtrace`, keep only the latter after beta promotion.
if stage == 0 {
eddyb marked this conversation as resolved.
Show resolved Hide resolved
rustflags.arg("-Zexternal-macro-backtrace");
} else {
rustflags.arg("-Zmacro-backtrace");
}

let want_rustdoc = self.doc_tests != DocTests::No;

Expand Down
10 changes: 5 additions & 5 deletions src/librustc_errors/annotate_snippet_emitter_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -32,12 +32,12 @@ impl Emitter for AnnotateSnippetEmitterWriter {
let mut children = diag.children.clone();
let (mut primary_span, suggestions) = self.primary_span_formatted(&diag);

self.fix_multispans_in_std_macros(
self.fix_multispans_in_extern_macros_and_render_macro_backtrace(
&self.source_map,
&mut primary_span,
&mut children,
&diag.level,
self.external_macro_backtrace,
self.macro_backtrace,
);

self.emit_messages_default(
Expand Down Expand Up @@ -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.
Expand Down
Loading