Skip to content

Commit f6fc802

Browse files
committed
rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace.
1 parent 8f286db commit f6fc802

File tree

79 files changed

+141
-149
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+141
-149
lines changed

src/bootstrap/builder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,13 @@ impl<'a> Builder<'a> {
847847
rustflags.arg("-Zforce-unstable-if-unmarked");
848848
}
849849

850-
rustflags.arg("-Zexternal-macro-backtrace");
850+
// cfg(bootstrap): the flag was renamed from `-Zexternal-macro-backtrace`
851+
// to `-Zmacro-backtrace`, keep only the latter after beta promotion.
852+
if stage == 0 {
853+
rustflags.arg("-Zexternal-macro-backtrace");
854+
} else {
855+
rustflags.arg("-Zmacro-backtrace");
856+
}
851857

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

src/librustc_errors/annotate_snippet_emitter_writer.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct AnnotateSnippetEmitterWriter {
2323
/// If true, will normalize line numbers with `LL` to prevent noise in UI test diffs.
2424
ui_testing: bool,
2525

26-
external_macro_backtrace: bool,
26+
macro_backtrace: bool,
2727
}
2828

2929
impl Emitter for AnnotateSnippetEmitterWriter {
@@ -37,7 +37,7 @@ impl Emitter for AnnotateSnippetEmitterWriter {
3737
&mut primary_span,
3838
&mut children,
3939
&diag.level,
40-
self.external_macro_backtrace,
40+
self.macro_backtrace,
4141
);
4242

4343
self.emit_messages_default(
@@ -172,9 +172,9 @@ impl AnnotateSnippetEmitterWriter {
172172
pub fn new(
173173
source_map: Option<Lrc<SourceMap>>,
174174
short_message: bool,
175-
external_macro_backtrace: bool,
175+
macro_backtrace: bool,
176176
) -> Self {
177-
Self { source_map, short_message, ui_testing: false, external_macro_backtrace }
177+
Self { source_map, short_message, ui_testing: false, macro_backtrace }
178178
}
179179

180180
/// Allows to modify `Self` to enable or disable the `ui_testing` flag.

src/librustc_errors/emitter.rs

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,11 @@ impl HumanReadableErrorType {
5454
source_map: Option<Lrc<SourceMap>>,
5555
teach: bool,
5656
terminal_width: Option<usize>,
57-
external_macro_backtrace: bool,
57+
macro_backtrace: bool,
5858
) -> EmitterWriter {
5959
let (short, color_config) = self.unzip();
6060
let color = color_config.suggests_using_colors();
61-
EmitterWriter::new(
62-
dst,
63-
source_map,
64-
short,
65-
teach,
66-
color,
67-
terminal_width,
68-
external_macro_backtrace,
69-
)
61+
EmitterWriter::new(dst, source_map, short, teach, color, terminal_width, macro_backtrace)
7062
}
7163
}
7264

@@ -294,12 +286,12 @@ pub trait Emitter {
294286
if self.fix_multispans_in_extern_macros(source_map, span, children) {
295287
let msg = if level == &Error {
296288
"this error originates in a macro outside of the current crate \
297-
(in Nightly builds, run with -Z external-macro-backtrace \
289+
(in Nightly builds, run with -Z macro-backtrace \
298290
for more info)"
299291
.to_string()
300292
} else {
301293
"this warning originates in a macro outside of the current crate \
302-
(in Nightly builds, run with -Z external-macro-backtrace \
294+
(in Nightly builds, run with -Z macro-backtrace \
303295
for more info)"
304296
.to_string()
305297
};
@@ -467,7 +459,7 @@ impl Emitter for EmitterWriter {
467459
&mut primary_span,
468460
&mut children,
469461
&diag.level,
470-
self.external_macro_backtrace,
462+
self.macro_backtrace,
471463
);
472464

473465
self.emit_messages_default(
@@ -546,7 +538,7 @@ pub struct EmitterWriter {
546538
ui_testing: bool,
547539
terminal_width: Option<usize>,
548540

549-
external_macro_backtrace: bool,
541+
macro_backtrace: bool,
550542
}
551543

552544
#[derive(Debug)]
@@ -563,7 +555,7 @@ impl EmitterWriter {
563555
short_message: bool,
564556
teach: bool,
565557
terminal_width: Option<usize>,
566-
external_macro_backtrace: bool,
558+
macro_backtrace: bool,
567559
) -> EmitterWriter {
568560
let dst = Destination::from_stderr(color_config);
569561
EmitterWriter {
@@ -573,7 +565,7 @@ impl EmitterWriter {
573565
teach,
574566
ui_testing: false,
575567
terminal_width,
576-
external_macro_backtrace,
568+
macro_backtrace,
577569
}
578570
}
579571

@@ -584,7 +576,7 @@ impl EmitterWriter {
584576
teach: bool,
585577
colored: bool,
586578
terminal_width: Option<usize>,
587-
external_macro_backtrace: bool,
579+
macro_backtrace: bool,
588580
) -> EmitterWriter {
589581
EmitterWriter {
590582
dst: Raw(dst, colored),
@@ -593,7 +585,7 @@ impl EmitterWriter {
593585
teach,
594586
ui_testing: false,
595587
terminal_width,
596-
external_macro_backtrace,
588+
macro_backtrace,
597589
}
598590
}
599591

src/librustc_errors/json.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct JsonEmitter {
3636
pretty: bool,
3737
ui_testing: bool,
3838
json_rendered: HumanReadableErrorType,
39-
external_macro_backtrace: bool,
39+
macro_backtrace: bool,
4040
}
4141

4242
impl JsonEmitter {
@@ -45,7 +45,7 @@ impl JsonEmitter {
4545
source_map: Lrc<SourceMap>,
4646
pretty: bool,
4747
json_rendered: HumanReadableErrorType,
48-
external_macro_backtrace: bool,
48+
macro_backtrace: bool,
4949
) -> JsonEmitter {
5050
JsonEmitter {
5151
dst: Box::new(io::stderr()),
@@ -54,22 +54,22 @@ impl JsonEmitter {
5454
pretty,
5555
ui_testing: false,
5656
json_rendered,
57-
external_macro_backtrace,
57+
macro_backtrace,
5858
}
5959
}
6060

6161
pub fn basic(
6262
pretty: bool,
6363
json_rendered: HumanReadableErrorType,
64-
external_macro_backtrace: bool,
64+
macro_backtrace: bool,
6565
) -> JsonEmitter {
6666
let file_path_mapping = FilePathMapping::empty();
6767
JsonEmitter::stderr(
6868
None,
6969
Lrc::new(SourceMap::new(file_path_mapping)),
7070
pretty,
7171
json_rendered,
72-
external_macro_backtrace,
72+
macro_backtrace,
7373
)
7474
}
7575

@@ -79,7 +79,7 @@ impl JsonEmitter {
7979
source_map: Lrc<SourceMap>,
8080
pretty: bool,
8181
json_rendered: HumanReadableErrorType,
82-
external_macro_backtrace: bool,
82+
macro_backtrace: bool,
8383
) -> JsonEmitter {
8484
JsonEmitter {
8585
dst,
@@ -88,7 +88,7 @@ impl JsonEmitter {
8888
pretty,
8989
ui_testing: false,
9090
json_rendered,
91-
external_macro_backtrace,
91+
macro_backtrace,
9292
}
9393
}
9494

@@ -245,13 +245,7 @@ impl Diagnostic {
245245
let buf = BufWriter::default();
246246
let output = buf.clone();
247247
je.json_rendered
248-
.new_emitter(
249-
Box::new(buf),
250-
Some(je.sm.clone()),
251-
false,
252-
None,
253-
je.external_macro_backtrace,
254-
)
248+
.new_emitter(Box::new(buf), Some(je.sm.clone()), false, None, je.macro_backtrace)
255249
.ui_testing(je.ui_testing)
256250
.emit_diagnostic(diag);
257251
let output = Arc::try_unwrap(output.0).unwrap().into_inner().unwrap();

src/librustc_errors/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,9 @@ pub struct HandlerFlags {
336336
/// If true, immediately print bugs registered with `delay_span_bug`.
337337
/// (rustc: see `-Z report-delayed-bugs`)
338338
pub report_delayed_bugs: bool,
339-
/// show macro backtraces even for non-local macros.
340-
/// (rustc: see `-Z external-macro-backtrace`)
341-
pub external_macro_backtrace: bool,
339+
/// Show macro backtraces.
340+
/// (rustc: see `-Z macro-backtrace`)
341+
pub macro_backtrace: bool,
342342
/// If true, identical diagnostics are reported only once.
343343
pub deduplicate_diagnostics: bool,
344344
}
@@ -385,7 +385,7 @@ impl Handler {
385385
false,
386386
false,
387387
None,
388-
flags.external_macro_backtrace,
388+
flags.macro_backtrace,
389389
));
390390
Self::with_emitter_and_flags(emitter, flags)
391391
}

src/librustc_session/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ impl DebuggingOptions {
624624
treat_err_as_bug: self.treat_err_as_bug,
625625
dont_buffer_diagnostics: self.dont_buffer_diagnostics,
626626
report_delayed_bugs: self.report_delayed_bugs,
627-
external_macro_backtrace: self.external_macro_backtrace,
627+
macro_backtrace: self.macro_backtrace,
628628
deduplicate_diagnostics: self.deduplicate_diagnostics.unwrap_or(true),
629629
}
630630
}

src/librustc_session/options.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,8 +776,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
776776
"treat error number `val` that occurs as bug"),
777777
report_delayed_bugs: bool = (false, parse_bool, [TRACKED],
778778
"immediately print bugs registered with `delay_span_bug`"),
779-
external_macro_backtrace: bool = (false, parse_bool, [UNTRACKED],
780-
"show macro backtraces even for non-local macros"),
779+
macro_backtrace: bool = (false, parse_bool, [UNTRACKED],
780+
"show macro backtraces"),
781781
teach: bool = (false, parse_bool, [TRACKED],
782782
"show extended diagnostic help"),
783783
terminal_width: Option<usize> = (None, parse_opt_uint, [UNTRACKED],

src/librustc_session/session.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ fn default_emitter(
858858
source_map: &Lrc<source_map::SourceMap>,
859859
emitter_dest: Option<Box<dyn Write + Send>>,
860860
) -> Box<dyn Emitter + sync::Send> {
861-
let external_macro_backtrace = sopts.debugging_opts.external_macro_backtrace;
861+
let macro_backtrace = sopts.debugging_opts.macro_backtrace;
862862
match (sopts.error_format, emitter_dest) {
863863
(config::ErrorOutputType::HumanReadable(kind), dst) => {
864864
let (short, color_config) = kind.unzip();
@@ -867,7 +867,7 @@ fn default_emitter(
867867
let emitter = AnnotateSnippetEmitterWriter::new(
868868
Some(source_map.clone()),
869869
short,
870-
external_macro_backtrace,
870+
macro_backtrace,
871871
);
872872
Box::new(emitter.ui_testing(sopts.debugging_opts.ui_testing()))
873873
} else {
@@ -878,7 +878,7 @@ fn default_emitter(
878878
short,
879879
sopts.debugging_opts.teach,
880880
sopts.debugging_opts.terminal_width,
881-
external_macro_backtrace,
881+
macro_backtrace,
882882
),
883883
Some(dst) => EmitterWriter::new(
884884
dst,
@@ -887,7 +887,7 @@ fn default_emitter(
887887
false, // no teach messages when writing to a buffer
888888
false, // no colors when writing to a buffer
889889
None, // no terminal width
890-
external_macro_backtrace,
890+
macro_backtrace,
891891
),
892892
};
893893
Box::new(emitter.ui_testing(sopts.debugging_opts.ui_testing()))
@@ -899,7 +899,7 @@ fn default_emitter(
899899
source_map.clone(),
900900
pretty,
901901
json_rendered,
902-
external_macro_backtrace,
902+
macro_backtrace,
903903
)
904904
.ui_testing(sopts.debugging_opts.ui_testing()),
905905
),
@@ -910,7 +910,7 @@ fn default_emitter(
910910
source_map.clone(),
911911
pretty,
912912
json_rendered,
913-
external_macro_backtrace,
913+
macro_backtrace,
914914
)
915915
.ui_testing(sopts.debugging_opts.ui_testing()),
916916
),

src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | x.x[0];
99
| ------ borrow later used here
1010
|
1111
= note: consider using a `let` binding to create a longer lived value
12-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
12+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
1313

1414
error: aborting due to previous error
1515

src/test/ui/borrowck/issue-64453.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ LL | static settings_dir: String = format!("");
66
|
77
= note: for more information, see https://github.com/rust-lang/rust/issues/49146
88
= help: add `#![feature(const_if_match)]` to the crate attributes to enable
9-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
9+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
1010

1111
error: aborting due to previous error
1212

src/test/ui/codemap_tests/bad-format-args.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: requires at least a format string argument
44
LL | format!();
55
| ^^^^^^^^^^
66
|
7-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
7+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
error: expected token: `,`
1010
--> $DIR/bad-format-args.rs:3:16

src/test/ui/consts/const-eval/const_fn_ptr_fail2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ LL | assert_eq!(Y, 4);
1212
| |
1313
| referenced constant has errors
1414
|
15-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
15+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
1616

1717
error[E0080]: evaluation of constant expression failed
1818
--> $DIR/const_fn_ptr_fail2.rs:22:5
@@ -22,7 +22,7 @@ LL | assert_eq!(Z, 4);
2222
| |
2323
| referenced constant has errors
2424
|
25-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
25+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
2626

2727
error: aborting due to 2 previous errors
2828

src/test/ui/consts/const-eval/const_panic.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | pub const Z: () = panic!("cheese");
77
| the evaluated program panicked at 'cheese', $DIR/const_panic.rs:4:19
88
|
99
= note: `#[deny(const_err)]` on by default
10-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
10+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
1111

1212
error: any use of this value will cause an error
1313
--> $DIR/const_panic.rs:7:19
@@ -17,7 +17,7 @@ LL | pub const Y: () = unreachable!();
1717
| |
1818
| the evaluated program panicked at 'internal error: entered unreachable code', $DIR/const_panic.rs:7:19
1919
|
20-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
20+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
2121

2222
error: any use of this value will cause an error
2323
--> $DIR/const_panic.rs:10:19
@@ -27,7 +27,7 @@ LL | pub const X: () = unimplemented!();
2727
| |
2828
| the evaluated program panicked at 'not implemented', $DIR/const_panic.rs:10:19
2929
|
30-
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
30+
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
3131

3232
error: aborting due to 3 previous errors
3333

0 commit comments

Comments
 (0)