resolve: Consolidate error reporting for resolved macros in fn resolve_macro_to_def
This commit is contained in:
parent
3a44ee68fb
commit
23e9a1def5
18 changed files with 172 additions and 198 deletions
|
|
@ -22,7 +22,7 @@ extern crate proc_macro_gates as foo;
|
|||
|
||||
use foo::*;
|
||||
|
||||
#[foo::a] //~ ERROR: paths of length greater than one
|
||||
#[foo::a] //~ ERROR: non-ident attribute macro paths are unstable
|
||||
fn _test() {}
|
||||
|
||||
fn _test_inner() {
|
||||
|
|
|
|||
|
|
@ -2,37 +2,37 @@ error: can't use a procedural macro from the same crate that defines it
|
|||
--> $DIR/macro-namespace-reserved-2.rs:34:5
|
||||
|
|
||||
LL | my_macro!(); //~ ERROR can't use a procedural macro from the same crate that defines it
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
||||
error: can't use a procedural macro from the same crate that defines it
|
||||
--> $DIR/macro-namespace-reserved-2.rs:37:5
|
||||
|
|
||||
LL | my_macro_attr!(); //~ ERROR can't use a procedural macro from the same crate that defines it
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: can't use a procedural macro from the same crate that defines it
|
||||
--> $DIR/macro-namespace-reserved-2.rs:40:5
|
||||
|
|
||||
LL | MyTrait!(); //~ ERROR can't use a procedural macro from the same crate that defines it
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^
|
||||
|
||||
error: can't use a procedural macro from the same crate that defines it
|
||||
--> $DIR/macro-namespace-reserved-2.rs:43:1
|
||||
--> $DIR/macro-namespace-reserved-2.rs:44:3
|
||||
|
|
||||
LL | #[my_macro] //~ ERROR can't use a procedural macro from the same crate that defines it
|
||||
| ^^^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
||||
error: can't use a procedural macro from the same crate that defines it
|
||||
--> $DIR/macro-namespace-reserved-2.rs:45:1
|
||||
--> $DIR/macro-namespace-reserved-2.rs:46:3
|
||||
|
|
||||
LL | #[my_macro_attr] //~ ERROR can't use a procedural macro from the same crate that defines it
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
||||
error: can't use a procedural macro from the same crate that defines it
|
||||
--> $DIR/macro-namespace-reserved-2.rs:47:1
|
||||
--> $DIR/macro-namespace-reserved-2.rs:48:3
|
||||
|
|
||||
LL | #[MyTrait] //~ ERROR can't use a procedural macro from the same crate that defines it
|
||||
| ^^^^^^^^^^
|
||||
| ^^^^^^^
|
||||
|
||||
error: can't use a procedural macro from the same crate that defines it
|
||||
--> $DIR/macro-namespace-reserved-2.rs:50:10
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0658]: The attribute `unknown` is currently unknown to the compiler and m
|
|||
--> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:13:27
|
||||
|
|
||||
LL | #[cfg_attr(all(), unknown)] //~ ERROR `unknown` is currently unknown
|
||||
| ^^^^^^^^
|
||||
| ^^^^^^^
|
||||
...
|
||||
LL | foo!();
|
||||
| ------- in this macro invocation
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/custom_attribute.rs:13:1
|
||||
--> $DIR/custom_attribute.rs:13:3
|
||||
|
|
||||
LL | #[foo] //~ ERROR The attribute `foo`
|
||||
| ^^^^^^
|
||||
| ^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/custom_attribute.rs:15:5
|
||||
--> $DIR/custom_attribute.rs:15:7
|
||||
|
|
||||
LL | #[foo] //~ ERROR The attribute `foo`
|
||||
| ^^^^^^
|
||||
| ^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/custom_attribute.rs:17:5
|
||||
--> $DIR/custom_attribute.rs:17:7
|
||||
|
|
||||
LL | #[foo] //~ ERROR The attribute `foo`
|
||||
| ^^^^^^
|
||||
| ^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,104 +1,104 @@
|
|||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:17:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:17:3
|
||||
|
|
||||
LL | #[fake_attr] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:18:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:18:3
|
||||
|
|
||||
LL | #[fake_attr(100)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:19:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:19:3
|
||||
|
|
||||
LL | #[fake_attr(1, 2, 3)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:20:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:20:3
|
||||
|
|
||||
LL | #[fake_attr("hello")] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:21:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:21:3
|
||||
|
|
||||
LL | #[fake_attr(name = "hello")] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:22:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:22:3
|
||||
|
|
||||
LL | #[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:23:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:23:3
|
||||
|
|
||||
LL | #[fake_attr(key = "hello", val = 10)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:24:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:24:3
|
||||
|
|
||||
LL | #[fake_attr(key("hello"), val(10))] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:25:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:25:3
|
||||
|
|
||||
LL | #[fake_attr(enabled = true, disabled = false)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:26:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:26:3
|
||||
|
|
||||
LL | #[fake_attr(true)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:27:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:27:3
|
||||
|
|
||||
LL | #[fake_attr(pi = 3.14159)] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:28:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:28:3
|
||||
|
|
||||
LL | #[fake_attr(b"hi")] //~ ERROR attribute `fake_attr` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `fake_doc` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/feature-gate-custom_attribute.rs:29:1
|
||||
--> $DIR/feature-gate-custom_attribute.rs:29:3
|
||||
|
|
||||
LL | #[fake_doc(r"doc")] //~ ERROR attribute `fake_doc` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0658]: attributes of the form `#[derive_*]` are reserved for the compiler (see issue #29644)
|
||||
--> $DIR/feature-gate-custom_derive.rs:11:1
|
||||
--> $DIR/feature-gate-custom_derive.rs:11:3
|
||||
|
|
||||
LL | #[derive_Clone]
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_derive)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642)
|
||||
--> $DIR/feature-gate-rustc-attrs.rs:15:1
|
||||
--> $DIR/feature-gate-rustc-attrs.rs:15:3
|
||||
|
|
||||
LL | #[rustc_foo]
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0658]: tool attributes are unstable (see issue #44690)
|
||||
--> $DIR/feature-gate-tool_attributes.rs:12:5
|
||||
--> $DIR/feature-gate-tool_attributes.rs:12:7
|
||||
|
|
||||
LL | #[rustfmt::skip] //~ ERROR tool attributes are unstable
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(tool_attributes)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0658]: attributes of the form `#[derive_*]` are reserved for the compiler (see issue #29644)
|
||||
--> $DIR/issue-32655.rs:16:9
|
||||
--> $DIR/issue-32655.rs:16:11
|
||||
|
|
||||
LL | #[derive_Clone] //~ ERROR attributes of the form
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^
|
||||
...
|
||||
LL | foo!();
|
||||
| ------- in this macro invocation
|
||||
|
|
@ -10,10 +10,10 @@ LL | foo!();
|
|||
= help: add #![feature(custom_derive)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: attributes of the form `#[derive_*]` are reserved for the compiler (see issue #29644)
|
||||
--> $DIR/issue-32655.rs:28:5
|
||||
--> $DIR/issue-32655.rs:28:7
|
||||
|
|
||||
LL | #[derive_Clone] //~ ERROR attributes of the form
|
||||
| ^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_derive)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0658]: The attribute `marco_use` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/issue-49074.rs:13:1
|
||||
--> $DIR/issue-49074.rs:13:3
|
||||
|
|
||||
LL | #[marco_use] // typo
|
||||
| ^^^^^^^^^^^^
|
||||
| ^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@ LL | #![feature(macro_reexport)] //~ ERROR feature has been removed
|
|||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error[E0658]: The attribute `macro_reexport` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/macro-reexport-removed.rs:15:1
|
||||
--> $DIR/macro-reexport-removed.rs:15:3
|
||||
|
|
||||
LL | #[macro_reexport(macro_one)] //~ ERROR attribute `macro_reexport` is currently unknown
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics (see issue #29642)
|
||||
--> $DIR/reserved-attr-on-macro.rs:11:1
|
||||
--> $DIR/reserved-attr-on-macro.rs:11:3
|
||||
|
|
||||
LL | #[rustc_attribute_should_be_reserved] //~ ERROR attributes with the prefix `rustc_` are reserved
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: add #![feature(rustc_attrs)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/issue-36530.rs:11:1
|
||||
--> $DIR/issue-36530.rs:11:3
|
||||
|
|
||||
LL | #[foo] //~ ERROR is currently unknown to the compiler
|
||||
| ^^^^^^
|
||||
| ^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
|
||||
--> $DIR/issue-36530.rs:13:5
|
||||
--> $DIR/issue-36530.rs:13:8
|
||||
|
|
||||
LL | #![foo] //~ ERROR is currently unknown to the compiler
|
||||
| ^^^^^^^
|
||||
| ^^^
|
||||
|
|
||||
= help: add #![feature(custom_attribute)] to the crate attributes to enable
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue