rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.

This commit is contained in:
Eduard-Mihai Burtescu 2019-12-16 15:56:47 +02:00
parent ab080973cb
commit 4c7eb59e81
280 changed files with 888 additions and 119 deletions

View file

@ -3,6 +3,8 @@ error: expected `:`, found `}`
|
LL | A
| ^ expected `:`
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: proc-macro derive produced unparseable tokens
--> $DIR/derive-bad.rs:7:5

View file

@ -15,6 +15,8 @@ error: cannot find attribute `empty_helper` in this scope
|
LL | #[derive(GenHelperUse)]
| ^^^^^^^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: cannot find attribute `empty_helper` in this scope
--> $DIR/derive-helper-shadowing.rs:14:11
@ -24,6 +26,8 @@ LL | #[empty_helper]
...
LL | gen_helper_use!();
| ------------------ in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0659]: `empty_helper` is ambiguous (name vs any other name during import resolution)
--> $DIR/derive-helper-shadowing.rs:24:13

View file

@ -11,6 +11,7 @@ LL | local!();
| --------- in this macro invocation
|
= note: `D` must be defined only once in the type namespace of this module
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0428]: the name `D` is defined multiple times
--> $DIR/dollar-crate.rs:36:5
@ -22,7 +23,7 @@ LL | dollar_crate_external::external!();
| previous definition of the type `D` here
|
= note: `D` must be defined only once in the type namespace of this module
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z macro-backtrace for more info)
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 2 previous errors

View file

@ -6,6 +6,7 @@ LL | #[derive(Unstable)]
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View file

@ -5,6 +5,7 @@ LL | #[derive(Unstable)]
| ^^^^^^^^
|
= help: add `#![feature(core_intrinsics)]` to the crate attributes to enable
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View file

@ -6,6 +6,8 @@ LL | gen_macro_rules!();
...
LL | generated!();
| ------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `local_use` in this scope
--> $DIR/gen-macro-rules-hygiene.rs:12:1
@ -15,6 +17,8 @@ LL | gen_macro_rules!();
...
LL | generated!();
| ------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `local_def` in this scope
--> $DIR/gen-macro-rules-hygiene.rs:21:9

View file

@ -6,6 +6,7 @@ LL | generate_mod::check!();
|
= note: possible candidate is found in another module, you can import it into scope:
FromOutside
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `Outer` in this scope
--> $DIR/generate-mod.rs:9:1
@ -15,6 +16,7 @@ LL | generate_mod::check!();
|
= note: possible candidate is found in another module, you can import it into scope:
Outer
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `FromOutside` in this scope
--> $DIR/generate-mod.rs:12:1
@ -24,6 +26,7 @@ LL | #[generate_mod::check_attr]
|
= note: possible candidate is found in another module, you can import it into scope:
FromOutside
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0412]: cannot find type `OuterAttr` in this scope
--> $DIR/generate-mod.rs:12:1
@ -33,6 +36,7 @@ LL | #[generate_mod::check_attr]
|
= note: possible candidate is found in another module, you can import it into scope:
OuterAttr
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
warning: cannot find type `FromOutside` in this scope
--> $DIR/generate-mod.rs:16:10

View file

@ -3,6 +3,8 @@ error: unexpected closing delimiter: `)`
|
LL | lexer_failure!();
| ^^^^^^^^^^^^^^^^^ unexpected closing delimiter
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: proc macro panicked
--> $DIR/invalid-punct-ident-4.rs:6:1

View file

@ -3,6 +3,8 @@ error[E0425]: cannot find value `foo` in this scope
|
LL | #[derive(A)]
| ^ not found in this scope
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View file

@ -9,12 +9,16 @@ error[E0616]: field `field` of struct `Restricted` is private
|
LL | #[derive(Derive)]
| ^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0616]: field `field` of struct `Restricted` is private
--> $DIR/issue-50493.rs:6:10
|
LL | #[derive(Derive)]
| ^^^^^^
|
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 3 previous errors

View file

@ -3,6 +3,8 @@ error: expected crate top-level item to be a module after macro expansion, found
|
LL | #![issue_59191::no_main]
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in an attribute macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0601]: `main` function not found in crate `issue_59191_replace_root_with_fn`
--> $DIR/issue-59191-replace-root-with-fn.rs:5:1

View file

@ -3,6 +3,8 @@ error[E0425]: cannot find value `foobar2` in this scope
|
LL | bang_proc_macro2!();
| ^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `foobar`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

View file

@ -3,12 +3,16 @@ error[E0426]: use of undeclared label `'label_use`
|
LL | proc_macro_rules!();
| ^^^^^^^^^^^^^^^^^^^^ undeclared label `'label_use`
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `local_use` in this scope
--> $DIR/mixed-site-span.rs:15:9
|
LL | proc_macro_rules!();
| ^^^^^^^^^^^^^^^^^^^^ not found in this scope
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `local_def` in this scope
--> $DIR/mixed-site-span.rs:19:9
@ -33,6 +37,7 @@ LL | | }
LL | pass_dollar_crate!();
| --------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
help: possible candidate is found in another module, you can import it into scope
|
LL | use ItemUse;

View file

@ -20,6 +20,7 @@ note: found these 'hi's
|
LL | hello!(hi);
| ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: hello to you, too!
--> $DIR/auxiliary/multispan.rs:31:1
@ -43,6 +44,7 @@ note: found these 'hi's
|
LL | hello!(hi hi);
| ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: hello to you, too!
--> $DIR/auxiliary/multispan.rs:31:1
@ -66,6 +68,7 @@ note: found these 'hi's
|
LL | hello!(hi hi hi);
| ^^ ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: hello to you, too!
--> $DIR/auxiliary/multispan.rs:31:1
@ -89,6 +92,7 @@ note: found these 'hi's
|
LL | hello!(hi hey hi yo hi beep beep hi hi);
| ^^ ^^ ^^ ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: hello to you, too!
--> $DIR/auxiliary/multispan.rs:31:1
@ -112,6 +116,7 @@ note: found these 'hi's
|
LL | hello!(hi there, hi how are you? hi... hi.);
| ^^ ^^ ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: hello to you, too!
--> $DIR/auxiliary/multispan.rs:31:1
@ -135,6 +140,7 @@ note: found these 'hi's
|
LL | hello!(whoah. hi di hi di ho);
| ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: hello to you, too!
--> $DIR/auxiliary/multispan.rs:31:1
@ -158,6 +164,7 @@ note: found these 'hi's
|
LL | hello!(hi good hi and good bye);
| ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 7 previous errors

View file

@ -6,6 +6,8 @@ LL | three!($a, $b);
...
LL | one!("hello", "world");
| ----------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: second final: "world"
--> $DIR/parent-source-spans.rs:19:16
@ -15,6 +17,8 @@ LL | three!($a, $b);
...
LL | one!("hello", "world");
| ----------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: first parent: "hello"
--> $DIR/parent-source-spans.rs:13:5
@ -24,6 +28,8 @@ LL | two!($a, $b);
...
LL | one!("hello", "world");
| ----------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: second parent: "world"
--> $DIR/parent-source-spans.rs:13:5
@ -33,6 +39,8 @@ LL | two!($a, $b);
...
LL | one!("hello", "world");
| ----------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: first grandparent: "hello"
--> $DIR/parent-source-spans.rs:39:5
@ -66,6 +74,8 @@ LL | three!($a, $b);
...
LL | two!("yay", "rust");
| -------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: second final: "rust"
--> $DIR/parent-source-spans.rs:19:16
@ -75,6 +85,8 @@ LL | three!($a, $b);
...
LL | two!("yay", "rust");
| -------------------- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: first parent: "yay"
--> $DIR/parent-source-spans.rs:45:5
@ -137,6 +149,8 @@ LL | one!("hello", "world");
|
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| --------------------------------------------------- similarly named tuple variant `Ok` defined here
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `ok` in this scope
--> $DIR/parent-source-spans.rs:32:5
@ -151,6 +165,8 @@ LL | two!("yay", "rust");
|
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| --------------------------------------------------- similarly named tuple variant `Ok` defined here
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0425]: cannot find value `ok` in this scope
--> $DIR/parent-source-spans.rs:32:5
@ -165,6 +181,8 @@ LL | three!("hip", "hop");
|
LL | Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
| --------------------------------------------------- similarly named tuple variant `Ok` defined here
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 21 previous errors

View file

@ -9,6 +9,7 @@ note: here
|
LL | subspan!("hi");
| ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:14:1
@ -21,6 +22,7 @@ note: here
|
LL | subspan!("hihi");
| ^^^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:17:1
@ -33,6 +35,7 @@ note: here
|
LL | subspan!("hihihi");
| ^^^^^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:20:1
@ -45,6 +48,7 @@ note: here
|
LL | subspan!("why I hide? hi!");
| ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:21:1
@ -57,6 +61,7 @@ note: here
|
LL | subspan!("hey, hi, hidy, hidy, hi hi");
| ^^ ^^ ^^ ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:22:1
@ -69,6 +74,7 @@ note: here
|
LL | subspan!("this is a hi, and this is another hi");
| ^^ ^^ ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:23:1
@ -81,6 +87,7 @@ note: here
|
LL | subspan!("how are you this evening");
| ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: found 'hi's
--> $DIR/subspan.rs:24:1
@ -93,6 +100,7 @@ note: here
|
LL | subspan!("this is highly eradic");
| ^^ ^^
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 8 previous errors

View file

@ -16,6 +16,7 @@ LL | three_equals!(==);
| ------------------ in this macro invocation
|
= help: input must be: `===`
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected EOF, found `=`.
--> $DIR/three-equals.rs:18:21