Skip to content

Commit adea7cb

Browse files
committed
Auto merge of rust-lang#138379 - estebank:macro-backtrace-note, r=petrochenkov
Do not suggest using `-Zmacro-backtrace` for builtin macros For macros that are implemented on the compiler, or that are annotated with `rustc_diagnostic_item`, which have arbitrary implementations from the point of view of the user and might as well be intrinsics, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros like `panic!` and `format!`. This PR adds a field to every `Span`'s `ExpnData` stating whether it comes from a builtin macro. This is determined by the macro being annotated with either `#[rustc_builtin_macro]` or `#[rustc_diagnostic_item]`. An alternative to using these attributes that already exist for other uses would be to introduce another attribute like `#[rustc_no_backtrace]` to have finer control on which macros are affected (for example, an error within `vec![]` now doesn't mention the backtrace, but one could make the case that it should). Ideally, instead of carrying this information in the `ExpnData` we'd instead try to query the `DefId` of the macro (that is already stored) to see if it is annotated in some way, but we do not have access to the `TyCtxt` from `rustc_errors`. r? `@petrochenkov`
2 parents 2828650 + f0b8e13 commit adea7cb

File tree

205 files changed

+27
-495
lines changed

Some content is hidden

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

205 files changed

+27
-495
lines changed

compiler/rustc_errors/src/emitter.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,9 @@ pub trait Emitter: Translate {
297297
// are some which do actually involve macros.
298298
ExpnKind::Desugaring(..) | ExpnKind::AstPass(..) => None,
299299

300-
ExpnKind::Macro(macro_kind, name) => Some((macro_kind, name)),
300+
ExpnKind::Macro(macro_kind, name) => {
301+
Some((macro_kind, name, expn_data.hide_backtrace))
302+
}
301303
}
302304
})
303305
.collect();
@@ -309,13 +311,17 @@ pub trait Emitter: Translate {
309311
self.render_multispans_macro_backtrace(span, children, backtrace);
310312

311313
if !backtrace {
312-
if let Some((macro_kind, name)) = has_macro_spans.first() {
314+
// Skip builtin macros, as their expansion isn't relevant to the end user. This includes
315+
// actual intrinsics, like `asm!`.
316+
if let Some((macro_kind, name, _)) = has_macro_spans.first()
317+
&& let Some((_, _, false)) = has_macro_spans.last()
318+
{
313319
// Mark the actual macro this originates from
314-
let and_then = if let Some((macro_kind, last_name)) = has_macro_spans.last()
320+
let and_then = if let Some((macro_kind, last_name, _)) = has_macro_spans.last()
315321
&& last_name != name
316322
{
317323
let descr = macro_kind.descr();
318-
format!(" which comes from the expansion of the {descr} `{last_name}`",)
324+
format!(" which comes from the expansion of the {descr} `{last_name}`")
319325
} else {
320326
"".to_string()
321327
};

compiler/rustc_expand/src/base.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -889,16 +889,16 @@ impl SyntaxExtension {
889889
})
890890
.unwrap_or_else(|| (None, helper_attrs));
891891

892-
let stability = find_attr!(attrs, AttributeKind::Stability{stability, ..} => *stability);
892+
let stability = find_attr!(attrs, AttributeKind::Stability { stability, .. } => *stability);
893893

894894
// FIXME(jdonszelmann): make it impossible to miss the or_else in the typesystem
895-
if let Some(sp) = find_attr!(attrs, AttributeKind::ConstStability{span, ..} => *span) {
895+
if let Some(sp) = find_attr!(attrs, AttributeKind::ConstStability { span, .. } => *span) {
896896
sess.dcx().emit_err(errors::MacroConstStability {
897897
span: sp,
898898
head_span: sess.source_map().guess_head_span(span),
899899
});
900900
}
901-
if let Some(sp) = find_attr!(attrs, AttributeKind::BodyStability{span, ..} => *span) {
901+
if let Some(sp) = find_attr!(attrs, AttributeKind::BodyStability{ span, .. } => *span) {
902902
sess.dcx().emit_err(errors::MacroBodyStability {
903903
span: sp,
904904
head_span: sess.source_map().guess_head_span(span),
@@ -912,7 +912,10 @@ impl SyntaxExtension {
912912
// FIXME(jdonszelmann): avoid the into_iter/collect?
913913
.then(|| allow_internal_unstable.iter().map(|i| i.0).collect::<Vec<_>>().into()),
914914
stability,
915-
deprecation: find_attr!(attrs, AttributeKind::Deprecation{deprecation, ..} => *deprecation),
915+
deprecation: find_attr!(
916+
attrs,
917+
AttributeKind::Deprecation { deprecation, .. } => *deprecation
918+
),
916919
helper_attrs,
917920
edition,
918921
builtin_name,
@@ -1000,6 +1003,7 @@ impl SyntaxExtension {
10001003
self.allow_internal_unsafe,
10011004
self.local_inner_macros,
10021005
self.collapse_debuginfo,
1006+
self.builtin_name.is_some(),
10031007
)
10041008
}
10051009
}

compiler/rustc_span/src/hygiene.rs

+5
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,8 @@ pub struct ExpnData {
982982
/// Should debuginfo for the macro be collapsed to the outermost expansion site (in other
983983
/// words, was the macro definition annotated with `#[collapse_debuginfo]`)?
984984
pub(crate) collapse_debuginfo: bool,
985+
/// When true, we do not display the note telling people to use the `-Zmacro-backtrace` flag.
986+
pub hide_backtrace: bool,
985987
}
986988

987989
impl !PartialEq for ExpnData {}
@@ -1000,6 +1002,7 @@ impl ExpnData {
10001002
allow_internal_unsafe: bool,
10011003
local_inner_macros: bool,
10021004
collapse_debuginfo: bool,
1005+
hide_backtrace: bool,
10031006
) -> ExpnData {
10041007
ExpnData {
10051008
kind,
@@ -1014,6 +1017,7 @@ impl ExpnData {
10141017
allow_internal_unsafe,
10151018
local_inner_macros,
10161019
collapse_debuginfo,
1020+
hide_backtrace,
10171021
}
10181022
}
10191023

@@ -1038,6 +1042,7 @@ impl ExpnData {
10381042
allow_internal_unsafe: false,
10391043
local_inner_macros: false,
10401044
collapse_debuginfo: false,
1045+
hide_backtrace: false,
10411046
}
10421047
}
10431048

src/tools/clippy/tests/ui/derive_ord_xor_partial_ord.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ LL | impl PartialOrd for DeriveOrd {
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212
= note: `-D clippy::derive-ord-xor-partial-ord` implied by `-D warnings`
1313
= help: to override `-D warnings` add `#[allow(clippy::derive_ord_xor_partial_ord)]`
14-
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
1514

1615
error: you are deriving `Ord` but have implemented `PartialOrd` explicitly
1716
--> tests/ui/derive_ord_xor_partial_ord.rs:33:10
@@ -24,7 +23,6 @@ note: `PartialOrd` implemented here
2423
|
2524
LL | impl PartialOrd<DeriveOrdWithExplicitTypeVariable> for DeriveOrdWithExplicitTypeVariable {
2625
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27-
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
2826

2927
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
3028
--> tests/ui/derive_ord_xor_partial_ord.rs:47:1
@@ -42,7 +40,6 @@ note: `PartialOrd` implemented here
4240
|
4341
LL | #[derive(PartialOrd, PartialEq, Eq)]
4442
| ^^^^^^^^^^
45-
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
4643

4744
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
4845
--> tests/ui/derive_ord_xor_partial_ord.rs:69:5
@@ -60,7 +57,6 @@ note: `PartialOrd` implemented here
6057
|
6158
LL | #[derive(PartialOrd, PartialEq, Eq)]
6259
| ^^^^^^^^^^
63-
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
6460

6561
error: aborting due to 4 previous errors
6662

src/tools/clippy/tests/ui/derived_hash_with_manual_eq.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ note: `PartialEq` implemented here
1010
LL | impl PartialEq for Bar {
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212
= note: `#[deny(clippy::derived_hash_with_manual_eq)]` on by default
13-
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
1413

1514
error: you are deriving `Hash` but have implemented `PartialEq` explicitly
1615
--> tests/ui/derived_hash_with_manual_eq.rs:23:10
@@ -23,7 +22,6 @@ note: `PartialEq` implemented here
2322
|
2423
LL | impl PartialEq<Baz> for Baz {
2524
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
26-
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
2725

2826
error: aborting due to 2 previous errors
2927

src/tools/clippy/tests/ui/diverging_sub_expression.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ error: sub-expression diverges
3636
|
3737
LL | _ => true || panic!("boo"),
3838
| ^^^^^^^^^^^^^
39-
|
40-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4139

4240
error: sub-expression diverges
4341
--> tests/ui/diverging_sub_expression.rs:52:29

src/tools/clippy/tests/ui/fallible_impl_from.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ note: potential failure(s)
3838
|
3939
LL | panic!();
4040
| ^^^^^^^^
41-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
4241

4342
error: consider implementing `TryFrom` instead
4443
--> tests/ui/fallible_impl_from.rs:40:1
@@ -64,7 +63,6 @@ LL | } else if s.parse::<u32>().unwrap() != 42 {
6463
| ^^^^^^^^^^^^^^^^^^^^^^^^^
6564
LL | panic!("{:?}", s);
6665
| ^^^^^^^^^^^^^^^^^
67-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
6866

6967
error: consider implementing `TryFrom` instead
7068
--> tests/ui/fallible_impl_from.rs:60:1
@@ -85,7 +83,6 @@ LL | if s.parse::<u32>().ok().unwrap() != 42 {
8583
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
8684
LL | panic!("{:?}", s);
8785
| ^^^^^^^^^^^^^^^^^
88-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
8986

9087
error: aborting due to 4 previous errors
9188

src/tools/clippy/tests/ui/impl_hash_with_borrow_str_and_bytes.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ LL | #[derive(Hash)]
2323
= note: ... as (`hash("abc") != hash("abc".as_bytes())`
2424
= help: consider either removing one of the `Borrow` implementations (`Borrow<str>` or `Borrow<[u8]>`) ...
2525
= help: ... or not implementing `Hash` for this type
26-
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
2726

2827
error: the semantics of `Borrow<T>` around `Hash` can't be satisfied when both `Borrow<str>` and `Borrow<[u8]>` are implemented
2928
--> tests/ui/impl_hash_with_borrow_str_and_bytes.rs:117:6

src/tools/clippy/tests/ui/issue-7447.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ LL | byte_view(panic!());
66
|
77
= note: `-D clippy::diverging-sub-expression` implied by `-D warnings`
88
= help: to override `-D warnings` add `#[allow(clippy::diverging_sub_expression)]`
9-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
109

1110
error: sub-expression diverges
1211
--> tests/ui/issue-7447.rs:29:19
1312
|
1413
LL | group_entries(panic!());
1514
| ^^^^^^^^
16-
|
17-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1815

1916
error: aborting due to 2 previous errors
2017

src/tools/clippy/tests/ui/same_name_method.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ note: existing `clone` defined here
2323
|
2424
LL | #[derive(Clone)]
2525
| ^^^^^
26-
= note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)
2726

2827
error: method's name is the same as an existing method in a trait
2928
--> tests/ui/same_name_method.rs:46:13

src/tools/miri/tests/fail/alloc/alloc_error_handler_custom.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ note: inside `miri_start`
2121
|
2222
LL | handle_alloc_error(Layout::for_value(&0));
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24-
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
2524

2625
error: aborting due to 1 previous error
2726

src/tools/miri/tests/fail/erroneous_const.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ error[E0080]: evaluation of `PrintName::<i32>::VOID` failed
33
|
44
LL | const VOID: ! = panic!();
55
| ^^^^^^^^ evaluation panicked: explicit panic
6-
|
7-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
86

97
note: erroneous constant encountered
108
--> tests/fail/erroneous_const.rs:LL:CC

src/tools/miri/tests/fail/panic/no_std.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ note: inside `miri_start`
1313
|
1414
LL | panic!("blarg I am dead")
1515
| ^^^^^^^^^^^^^^^^^^^^^^^^^
16-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
1716

1817
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
1918

src/tools/miri/tests/fail/panic/panic_abort1.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ note: inside `main`
2222
|
2323
LL | std::panic!("panicking from libstd");
2424
| ^
25-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
2625

2726
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
2827

src/tools/miri/tests/fail/panic/panic_abort2.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ note: inside `main`
2222
|
2323
LL | std::panic!("{}-panicking from libstd", 42);
2424
| ^
25-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `std::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
2625

2726
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
2827

src/tools/miri/tests/fail/panic/panic_abort3.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ note: inside `main`
2222
|
2323
LL | core::panic!("panicking from libcore");
2424
| ^
25-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
2625

2726
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
2827

src/tools/miri/tests/fail/panic/panic_abort4.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ note: inside `main`
2222
|
2323
LL | core::panic!("{}-panicking from libcore", 42);
2424
| ^
25-
= note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `core::panic` (in Nightly builds, run with -Z macro-backtrace for more info)
2625

2726
note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
2827

tests/run-make/non-unicode-env/non_unicode_env.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ error: environment variable `NON_UNICODE_VAR` is not a valid Unicode string
33
|
44
2 | let _ = env!("NON_UNICODE_VAR");
55
| ^^^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
= note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
86

97
error: environment variable `NON_UNICODE_VAR` is not a valid Unicode string
108
--> non_unicode_env.rs:3:13
119
|
1210
3 | let _ = option_env!("NON_UNICODE_VAR");
1311
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14-
|
15-
= note: this error originates in the macro `option_env` (in Nightly builds, run with -Z macro-backtrace for more info)
1612

1713
error: aborting due to 2 previous errors
1814

tests/rustdoc-ui/doctest/relative-path-include-bytes-132203.edition2015.stdout

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ error: couldn't read `$DIR/relative-dir-empty-file`: $FILE_NOT_FOUND_MSG (os err
1010
|
1111
LL | let x = include_bytes!("relative-dir-empty-file");
1212
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13-
|
14-
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
1513

1614
error: aborting due to 1 previous error
1715

tests/ui/alloc-error/alloc-error-handler-bad-signature-1.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ LL | fn oom(
1818
| ^^^
1919
LL | info: &Layout,
2020
| -------------
21-
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
2221

2322
error[E0308]: mismatched types
2423
--> $DIR/alloc-error-handler-bad-signature-1.rs:10:1
@@ -35,7 +34,6 @@ LL | | }
3534
|
3635
= note: expected type `!`
3736
found unit type `()`
38-
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
3937

4038
error: aborting due to 2 previous errors
4139

tests/ui/alloc-error/alloc-error-handler-bad-signature-2.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ LL | fn oom(
2626
| ^^^
2727
LL | info: Layout,
2828
| ------------
29-
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
3029

3130
error[E0308]: mismatched types
3231
--> $DIR/alloc-error-handler-bad-signature-2.rs:10:1
@@ -43,7 +42,6 @@ LL | | }
4342
|
4443
= note: expected type `!`
4544
found unit type `()`
46-
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
4745

4846
error: aborting due to 2 previous errors
4947

tests/ui/alloc-error/alloc-error-handler-bad-signature-3.stderr

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ note: function defined here
1414
|
1515
LL | fn oom() -> ! {
1616
| ^^^
17-
= note: this error originates in the attribute macro `alloc_error_handler` (in Nightly builds, run with -Z macro-backtrace for more info)
1817

1918
error: aborting due to 1 previous error
2019

tests/ui/allocator/not-an-allocator.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ LL | static A: usize = 0;
77
| ^^^^^ the trait `GlobalAlloc` is not implemented for `usize`
88
|
99
= help: the trait `GlobalAlloc` is implemented for `System`
10-
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
1110

1211
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
1312
--> $DIR/not-an-allocator.rs:2:11
@@ -19,7 +18,6 @@ LL | static A: usize = 0;
1918
|
2019
= help: the trait `GlobalAlloc` is implemented for `System`
2120
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
22-
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
2321

2422
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
2523
--> $DIR/not-an-allocator.rs:2:11
@@ -31,7 +29,6 @@ LL | static A: usize = 0;
3129
|
3230
= help: the trait `GlobalAlloc` is implemented for `System`
3331
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
34-
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
3532

3633
error[E0277]: the trait bound `usize: GlobalAlloc` is not satisfied
3734
--> $DIR/not-an-allocator.rs:2:11
@@ -43,7 +40,6 @@ LL | static A: usize = 0;
4340
|
4441
= help: the trait `GlobalAlloc` is implemented for `System`
4542
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
46-
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
4743

4844
error: aborting due to 4 previous errors
4945

tests/ui/allocator/two-allocators.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ LL | #[global_allocator]
77
| ------------------- in this procedural macro expansion
88
LL | static B: System = System;
99
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot define a new global allocator
10-
|
11-
= note: this error originates in the attribute macro `global_allocator` (in Nightly builds, run with -Z macro-backtrace for more info)
1210

1311
error: aborting due to 1 previous error
1412

tests/ui/asm/ice-bad-err-span-in-template-129503.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LL | asm!(concat!(r#"lJ𐏿Æ�.𐏿�"#, "r} {}"));
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unmatched `}` in asm template string
66
|
77
= note: if you intended to print `}`, you can escape it using `}}`
8-
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
98

109
error: invalid asm template string: unmatched `}` found
1110
--> $DIR/ice-bad-err-span-in-template-129503.rs:18:10
@@ -14,7 +13,6 @@ LL | asm!(concat!("abc", "r} {}"));
1413
| ^^^^^^^^^^^^^^^^^^^^^^^ unmatched `}` in asm template string
1514
|
1615
= note: if you intended to print `}`, you can escape it using `}}`
17-
= note: this error originates in the macro `concat` (in Nightly builds, run with -Z macro-backtrace for more info)
1816

1917
error: invalid asm template string: unmatched `}` found
2018
--> $DIR/ice-bad-err-span-in-template-129503.rs:24:19

0 commit comments

Comments
 (0)