Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwco

resolve: Improve candidate search for unresolved macro suggestions

Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names.

The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around).

This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086.
r? @davidtwco
This commit is contained in:
bors 2019-07-19 00:24:39 +00:00
commit fe499a7b34
66 changed files with 1170 additions and 1271 deletions

View file

@ -1,7 +1,9 @@
// Obsolete attributes fall back to feature gated custom attributes.
#[ab_isize="stdcall"] extern {} //~ ERROR attribute `ab_isize` is currently unknown
#[ab_isize="stdcall"] extern {}
//~^ ERROR cannot find attribute macro `ab_isize` in this scope
#[fixed_stack_segment] fn f() {} //~ ERROR attribute `fixed_stack_segment` is currently unknown
#[fixed_stack_segment] fn f() {}
//~^ ERROR cannot find attribute macro `fixed_stack_segment` in this scope
fn main() {}

View file

@ -1,21 +1,14 @@
error[E0658]: The attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/obsolete-attr.rs:5:3
error: cannot find attribute macro `fixed_stack_segment` in this scope
--> $DIR/obsolete-attr.rs:6:3
|
LL | #[fixed_stack_segment] fn f() {}
| ^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: The attribute `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `ab_isize` in this scope
--> $DIR/obsolete-attr.rs:3:3
|
LL | #[ab_isize="stdcall"] extern {}
| ^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -2,8 +2,11 @@
#![feature(custom_inner_attributes)]
#![mutable_doc] //~ ERROR attribute `mutable_doc` is currently unknown
#![mutable_doc]
//~^ ERROR cannot find attribute macro `mutable_doc` in this scope
#[dance] mod a {} //~ ERROR attribute `dance` is currently unknown
#[dance] mod a {}
//~^ ERROR cannot find attribute macro `dance` in this scope
#[dance] fn main() {} //~ ERROR attribute `dance` is currently unknown
#[dance] fn main() {}
//~^ ERROR cannot find attribute macro `dance` in this scope

View file

@ -1,30 +1,20 @@
error[E0658]: The attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `mutable_doc` in this scope
--> $DIR/unknown-attr.rs:5:4
|
LL | #![mutable_doc]
| ^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/unknown-attr.rs:7:3
error: cannot find attribute macro `dance` in this scope
--> $DIR/unknown-attr.rs:8:3
|
LL | #[dance] mod a {}
| ^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/unknown-attr.rs:9:3
error: cannot find attribute macro `dance` in this scope
--> $DIR/unknown-attr.rs:11:3
|
LL | #[dance] fn main() {}
| ^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,6 +1,7 @@
macro_rules! foo {
() => {
#[cfg_attr(all(), unknown)] //~ ERROR `unknown` is currently unknown
#[cfg_attr(all(), unknown)]
//~^ ERROR cannot find attribute macro `unknown` in this scope
fn foo() {}
}
}

View file

@ -1,4 +1,4 @@
error[E0658]: The attribute `unknown` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `unknown` in this scope
--> $DIR/cfg-attr-unknown-attribute-macro-expansion.rs:3:27
|
LL | #[cfg_attr(all(), unknown)]
@ -6,10 +6,6 @@ LL | #[cfg_attr(all(), unknown)]
...
LL | foo!();
| ------- in this macro invocation
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,9 +1,9 @@
#![feature(stmt_expr_attributes)]
#[foo] //~ ERROR The attribute `foo`
#[foo] //~ ERROR cannot find attribute macro `foo` in this scope
fn main() {
#[foo] //~ ERROR The attribute `foo`
#[foo] //~ ERROR cannot find attribute macro `foo` in this scope
let x = ();
#[foo] //~ ERROR The attribute `foo`
#[foo] //~ ERROR cannot find attribute macro `foo` in this scope
x
}

View file

@ -1,30 +1,20 @@
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `foo` in this scope
--> $DIR/custom_attribute.rs:3:3
|
LL | #[foo]
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
error: cannot find attribute macro `foo` in this scope
--> $DIR/custom_attribute.rs:5:7
|
LL | #[foo]
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
error: cannot find attribute macro `foo` in this scope
--> $DIR/custom_attribute.rs:7:7
|
LL | #[foo]
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -2,7 +2,7 @@ error: cannot find derive macro `Eqr` in this scope
--> $DIR/deriving-meta-unknown-trait.rs:1:10
|
LL | #[derive(Eqr)]
| ^^^ help: try: `Eq`
| ^^^ help: a derive macro with a similar name exists: `Eq`
error: aborting due to previous error

View file

@ -1,23 +1,18 @@
// Check that literals in attributes parse just fine.
#[fake_attr] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(100)] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(1, 2, 3)] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr("hello")] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(name = "hello")] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR cannot find attribute macro `fake_attr` in th
#[fake_attr(key = "hello", val = 10)] //~ ERROR cannot find attribute macro `fake_attr` in this scop
#[fake_attr(key("hello"), val(10))] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(enabled = true, disabled = false)] //~ ERROR cannot find attribute macro `fake_attr` in
#[fake_attr(true)] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(pi = 3.14159)] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_attr(b"hi")] //~ ERROR cannot find attribute macro `fake_attr` in this scope
#[fake_doc(r"doc")] //~ ERROR cannot find attribute macro `fake_doc` in this scope
struct Q {}
#![allow(dead_code)]
#![allow(unused_variables)]
#[fake_attr] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(100)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(1, 2, 3)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr("hello")] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(name = "hello")] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(1, "hi", key = 12, true, false)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(key = "hello", val = 10)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(key("hello"), val(10))] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(enabled = true, disabled = false)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(true)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(pi = 3.14159)] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_attr(b"hi")] //~ ERROR attribute `fake_attr` is currently unknown
#[fake_doc(r"doc")] //~ ERROR attribute `fake_doc` is currently unknown
struct Q { }
fn main() { }
fn main() {}

View file

@ -1,120 +1,80 @@
error[E0658]: The attribute `fake_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/feature-gate-custom_attribute.rs:7:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:3:3
|
LL | #[fake_attr]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:8:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:4:3
|
LL | #[fake_attr(100)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:9:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:5:3
|
LL | #[fake_attr(1, 2, 3)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:10:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:6:3
|
LL | #[fake_attr("hello")]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:11:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:7:3
|
LL | #[fake_attr(name = "hello")]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:12:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:8:3
|
LL | #[fake_attr(1, "hi", key = 12, true, false)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:13:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:9:3
|
LL | #[fake_attr(key = "hello", val = 10)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:14:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:10:3
|
LL | #[fake_attr(key("hello"), val(10))]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:15:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:11:3
|
LL | #[fake_attr(enabled = true, disabled = false)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:16:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:12:3
|
LL | #[fake_attr(true)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:17:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:13:3
|
LL | #[fake_attr(pi = 3.14159)]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:18:3
error: cannot find attribute macro `fake_attr` in this scope
--> $DIR/feature-gate-custom_attribute.rs:14:3
|
LL | #[fake_attr(b"hi")]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= 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
--> $DIR/feature-gate-custom_attribute.rs:19:3
error: cannot find attribute macro `fake_doc` in this scope
--> $DIR/feature-gate-custom_attribute.rs:15:3
|
LL | #[fake_doc(r"doc")]
| ^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 13 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -19,5 +19,5 @@ fn g() {}
//~^ ERROR used by the test suite
#[rustc_unknown]
//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
//~| ERROR attribute `rustc_unknown` is currently unknown
//~| ERROR cannot find attribute macro `rustc_unknown` in this scope
fn main() {}

View file

@ -37,14 +37,11 @@ LL | #[rustc_unknown]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error[E0658]: The attribute `rustc_unknown` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `rustc_unknown` in this scope
--> $DIR/feature-gate-rustc-attrs.rs:20:3
|
LL | #[rustc_unknown]
| ^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: used by the test suite
--> $DIR/feature-gate-rustc-attrs.rs:18:1

View file

@ -3,8 +3,6 @@ error: cannot find macro `print!` in this scope
|
LL | print!();
| ^^^^^
|
= help: have you added the `#[macro_use]` on the module/import?
error: aborting due to previous error

View file

@ -13,7 +13,6 @@ error: cannot find macro `panic!` in this scope
LL | assert_eq!(0, 0);
| ^^^^^^^^^^^^^^^^^
|
= help: have you added the `#[macro_use]` on the module/import?
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error[E0599]: no method named `clone` found for type `()` in the current scope

View file

@ -26,6 +26,6 @@ fn main() {
Opaque; //~ ERROR cannot find value `Opaque` in this scope
transparent; // OK
semitransparent; //~ ERROR cannot find value `semitransparent` in this scope
opaque; //~ ERROR cannot find value `opaque` in this scope
semitransparent; //~ ERROR expected value, found macro `semitransparent`
opaque; //~ ERROR expected value, found macro `opaque`
}

View file

@ -4,18 +4,19 @@ error[E0425]: cannot find value `Opaque` in this scope
LL | Opaque;
| ^^^^^^ help: a local variable with a similar name exists: `opaque`
error[E0425]: cannot find value `semitransparent` in this scope
error[E0423]: expected value, found macro `semitransparent`
--> $DIR/rustc-macro-transparency.rs:29:5
|
LL | semitransparent;
| ^^^^^^^^^^^^^^^ not found in this scope
| ^^^^^^^^^^^^^^^ help: use `!` to invoke the macro: `semitransparent!`
error[E0425]: cannot find value `opaque` in this scope
error[E0423]: expected value, found macro `opaque`
--> $DIR/rustc-macro-transparency.rs:30:5
|
LL | opaque;
| ^^^^^^ not found in this scope
| ^^^^^^ help: use `!` to invoke the macro: `opaque!`
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0425`.
Some errors have detailed explanations: E0423, E0425.
For more information about an error, try `rustc --explain E0423`.

View file

@ -6,9 +6,8 @@ fn foo(f: impl Display + Clone) -> String {
wants_clone(f);
}
fn wants_debug(g: impl Debug) { } //~ ERROR cannot find
fn wants_display(g: impl Debug) { } //~ ERROR cannot find
fn wants_debug(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug`
fn wants_display(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug`
fn wants_clone(g: impl Clone) { }
fn main() {
}
fn main() {}

View file

@ -1,23 +1,23 @@
error[E0405]: cannot find trait `Debug` in this scope
error[E0404]: expected trait, found derive macro `Debug`
--> $DIR/universal_wrong_bounds.rs:9:24
|
LL | fn wants_debug(g: impl Debug) { }
| ^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
| ^^^^^ not a trait
help: possible better candidate is found in another module, you can import it into scope
|
LL | use std::fmt::Debug;
|
error[E0405]: cannot find trait `Debug` in this scope
error[E0404]: expected trait, found derive macro `Debug`
--> $DIR/universal_wrong_bounds.rs:10:26
|
LL | fn wants_display(g: impl Debug) { }
| ^^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
| ^^^^^ not a trait
help: possible better candidate is found in another module, you can import it into scope
|
LL | use std::fmt::Debug;
|
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0405`.
For more information about this error, try `rustc --explain E0404`.

View file

@ -1,9 +1,6 @@
#![allow(dead_code)]
#![feature(rustc_attrs)]
macro_rules! foo (
() => (
#[derive_Clone] //~ ERROR attribute `derive_Clone` is currently unknown
#[derive_Clone] //~ ERROR cannot find attribute macro `derive_Clone` in this scope
struct T;
);
);
@ -15,7 +12,7 @@ macro_rules! bar (
foo!();
bar!(
#[derive_Clone] //~ ERROR attribute `derive_Clone` is currently unknown
#[derive_Clone] //~ ERROR cannot find attribute macro `derive_Clone` in this scope
struct S;
);

View file

@ -1,24 +1,17 @@
error[E0658]: The attribute `derive_Clone` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/issue-32655.rs:6:11
error: cannot find attribute macro `derive_Clone` in this scope
--> $DIR/issue-32655.rs:3:11
|
LL | #[derive_Clone]
| ^^^^^^^^^^^^
...
LL | foo!();
| ------- in this macro invocation
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: The attribute `derive_Clone` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/issue-32655.rs:18:7
error: cannot find attribute macro `derive_Clone` in this scope
--> $DIR/issue-32655.rs:15:7
|
LL | #[derive_Clone]
| ^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,5 +1,5 @@
struct Foo<T: ?Hash> { }
//~^ ERROR cannot find trait `Hash` in this scope
//~^ ERROR expected trait, found derive macro `Hash`
//~^^ ERROR parameter `T` is never used
//~^^^ WARN default bound relaxed for a type parameter, but this does nothing

View file

@ -1,9 +1,9 @@
error[E0405]: cannot find trait `Hash` in this scope
error[E0404]: expected trait, found derive macro `Hash`
--> $DIR/issue-37534.rs:1:16
|
LL | struct Foo<T: ?Hash> { }
| ^^^^ not found in this scope
help: possible candidate is found in another module, you can import it into scope
| ^^^^ not a trait
help: possible better candidate is found in another module, you can import it into scope
|
LL | use std::hash::Hash;
|
@ -24,5 +24,5 @@ LL | struct Foo<T: ?Hash> { }
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0392, E0405.
Some errors have detailed explanations: E0392, E0404.
For more information about an error, try `rustc --explain E0392`.

View file

@ -1,7 +1,7 @@
// Check that unknown attribute error is shown even if there are unresolved macros.
#[marco_use] // typo
//~^ ERROR The attribute `marco_use` is currently unknown to the compiler
//~^ ERROR cannot find attribute macro `marco_use` in this scope
mod foo {
macro_rules! bar {
() => ();

View file

@ -1,11 +1,8 @@
error[E0658]: The attribute `marco_use` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `marco_use` in this scope
--> $DIR/issue-49074.rs:3:3
|
LL | #[marco_use] // typo
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_use`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: cannot find macro `bar!` in this scope
--> $DIR/issue-49074.rs:12:4
@ -17,4 +14,3 @@ LL | bar!();
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -2,7 +2,7 @@ error: cannot find macro `printlx!` in this scope
--> $DIR/macro-name-typo.rs:2:5
|
LL | printlx!("oh noes!");
| ^^^^^^^ help: you could try the macro: `println`
| ^^^^^^^ help: a macro with a similar name exists: `println`
error: aborting due to previous error

View file

@ -2,7 +2,7 @@ error: cannot find macro `inline!` in this scope
--> $DIR/macro-path-prelude-fail-3.rs:2:5
|
LL | inline!();
| ^^^^^^ help: you could try the macro: `line`
| ^^^^^^ help: a macro with a similar name exists: `line`
error: aborting due to previous error

View file

@ -2,7 +2,7 @@
#![feature(macro_reexport)] //~ ERROR feature has been removed
#[macro_reexport(macro_one)] //~ ERROR attribute `macro_reexport` is currently unknown
#[macro_reexport(macro_one)] //~ ERROR cannot find attribute macro `macro_reexport` in this scope
extern crate two_macros;
fn main() {}

View file

@ -10,16 +10,12 @@ note: subsumed by `pub use`
LL | #![feature(macro_reexport)]
| ^^^^^^^^^^^^^^
error[E0658]: The attribute `macro_reexport` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `macro_reexport` in this scope
--> $DIR/macro-reexport-removed.rs:5:3
|
LL | #[macro_reexport(macro_one)]
| ^^^^^^^^^^^^^^ help: a built-in attribute with a similar name exists: `macro_export`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0557, E0658.
For more information about an error, try `rustc --explain E0557`.
For more information about this error, try `rustc --explain E0557`.

View file

@ -2,7 +2,7 @@ error: cannot find macro `macro_two!` in this scope
--> $DIR/macro-use-wrong-name.rs:7:5
|
LL | macro_two!();
| ^^^^^^^^^ help: you could try the macro: `macro_one`
| ^^^^^^^^^ help: a macro with a similar name exists: `macro_one`
error: aborting due to previous error

View file

@ -2,7 +2,7 @@ error: cannot find macro `k!` in this scope
--> $DIR/macro_undefined.rs:11:5
|
LL | k!();
| ^ help: you could try the macro: `kl`
| ^ help: a macro with a similar name exists: `kl`
error: aborting due to previous error

View file

@ -9,7 +9,7 @@ mod foo {
mod baz {
struct Test;
impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope
impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone`
impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope
@ -21,7 +21,7 @@ mod foo {
struct Test;
impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope
impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone`
impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope
@ -36,7 +36,7 @@ fn qux() {
mod qux_inner {
struct Test;
impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope
impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone`
impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope

View file

@ -8,12 +8,12 @@ help: possible candidate is found in another module, you can import it into scop
LL | use std::ops::Add;
|
error[E0405]: cannot find trait `Clone` in this scope
error[E0404]: expected trait, found derive macro `Clone`
--> $DIR/no-implicit-prelude-nested.rs:12:14
|
LL | impl Clone for Test {}
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
| ^^^^^ not a trait
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use std::clone::Clone;
|
@ -72,12 +72,12 @@ help: possible candidate is found in another module, you can import it into scop
LL | use std::ops::Add;
|
error[E0405]: cannot find trait `Clone` in this scope
error[E0404]: expected trait, found derive macro `Clone`
--> $DIR/no-implicit-prelude-nested.rs:24:10
|
LL | impl Clone for Test {}
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
| ^^^^^ not a trait
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use std::clone::Clone;
|
@ -136,12 +136,12 @@ help: possible candidate is found in another module, you can import it into scop
LL | use std::ops::Add;
|
error[E0405]: cannot find trait `Clone` in this scope
error[E0404]: expected trait, found derive macro `Clone`
--> $DIR/no-implicit-prelude-nested.rs:39:14
|
LL | impl Clone for Test {}
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
| ^^^^^ not a trait
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use std::clone::Clone;
|
@ -192,5 +192,5 @@ LL | use std::prelude::v1::drop;
error: aborting due to 18 previous errors
Some errors have detailed explanations: E0405, E0425.
For more information about an error, try `rustc --explain E0405`.
Some errors have detailed explanations: E0404, E0405, E0425.
For more information about an error, try `rustc --explain E0404`.

View file

@ -8,7 +8,7 @@
struct Test;
impl Add for Test {} //~ ERROR cannot find trait `Add` in this scope
impl Clone for Test {} //~ ERROR cannot find trait `Clone` in this scope
impl Clone for Test {} //~ ERROR expected trait, found derive macro `Clone`
impl Iterator for Test {} //~ ERROR cannot find trait `Iterator` in this scope
impl ToString for Test {} //~ ERROR cannot find trait `ToString` in this scope
impl Writer for Test {} //~ ERROR cannot find trait `Writer` in this scope

View file

@ -8,12 +8,12 @@ help: possible candidate is found in another module, you can import it into scop
LL | use std::ops::Add;
|
error[E0405]: cannot find trait `Clone` in this scope
error[E0404]: expected trait, found derive macro `Clone`
--> $DIR/no-implicit-prelude.rs:11:6
|
LL | impl Clone for Test {}
| ^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
| ^^^^^ not a trait
help: possible better candidates are found in other modules, you can import them into scope
|
LL | use std::clone::Clone;
|
@ -64,5 +64,5 @@ LL | use std::prelude::v1::drop;
error: aborting due to 6 previous errors
Some errors have detailed explanations: E0405, E0425.
For more information about an error, try `rustc --explain E0405`.
Some errors have detailed explanations: E0404, E0405, E0425.
For more information about an error, try `rustc --explain E0404`.

View file

@ -19,7 +19,7 @@ struct S {
struct U;
mod inner {
#[empty_helper] //~ ERROR attribute `empty_helper` is currently unknown
#[empty_helper] //~ ERROR cannot find attribute macro `empty_helper` in this scope
struct V;
}

View file

@ -1,11 +1,8 @@
error[E0658]: The attribute `empty_helper` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `empty_helper` in this scope
--> $DIR/derive-helper-shadowing.rs:22:15
|
LL | #[empty_helper]
| ^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0659]: `empty_helper` is ambiguous (derive helper attribute vs any other name)
--> $DIR/derive-helper-shadowing.rs:8:3
@ -27,5 +24,4 @@ LL | use test_macros::empty_attr as empty_helper;
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0658, E0659.
For more information about an error, try `rustc --explain E0658`.
For more information about this error, try `rustc --explain E0659`.

View file

@ -3,7 +3,7 @@
#[macro_use]
extern crate test_macros;
#[derive_Empty] //~ ERROR attribute `derive_Empty` is currently unknown
#[derive_Empty] //~ ERROR cannot find attribute macro `derive_Empty` in this scope
struct A;
fn main() {}

View file

@ -1,12 +1,8 @@
error[E0658]: The attribute `derive_Empty` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `derive_Empty` in this scope
--> $DIR/derive-still-gated.rs:6:3
|
LL | #[derive_Empty]
| ^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,11 +1,12 @@
// aux-build:derive-unstable-2.rs
#![feature(custom_attribute)]
#[macro_use]
extern crate derive_unstable_2;
#[derive(Unstable)]
//~^ ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
//~| ERROR attribute `rustc_foo` is currently unknown to the compiler
struct A;

View file

@ -1,5 +1,5 @@
error[E0658]: attributes starting with `rustc` are reserved for use by the `rustc` compiler
--> $DIR/expand-to-unstable-2.rs:6:10
--> $DIR/expand-to-unstable-2.rs:8:10
|
LL | #[derive(Unstable)]
| ^^^^^^^^
@ -7,15 +7,6 @@ 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
error[E0658]: The attribute `rustc_foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/expand-to-unstable-2.rs:6:10
|
LL | #[derive(Unstable)]
| ^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 2 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -3,11 +3,11 @@
// FIXME: https://github.com/rust-lang/rust/issues/41430
// This is a temporary regression test for the ICE reported in #41211
#![feature(custom_attribute)]
#![feature(custom_inner_attributes)]
#![identity_attr]
//~^ ERROR attribute `identity_attr` is currently unknown to the compiler
//~| ERROR inconsistent resolution for a macro: first custom attribute, then attribute macro
//~^ ERROR inconsistent resolution for a macro: first custom attribute, then attribute macro
extern crate test_macros;
use test_macros::identity_attr;

View file

@ -1,18 +1,8 @@
error[E0658]: The attribute `identity_attr` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/issue-41211.rs:8:4
|
LL | #![identity_attr]
| ^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: inconsistent resolution for a macro: first custom attribute, then attribute macro
--> $DIR/issue-41211.rs:8:4
--> $DIR/issue-41211.rs:9:4
|
LL | #![identity_attr]
| ^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -35,7 +35,7 @@ fn check_bang3() {
//~| ERROR expected macro, found derive macro `crate::MyTrait`
}
#[my_macro] //~ ERROR attribute `my_macro` is currently unknown
#[my_macro] //~ ERROR cannot find attribute macro `my_macro` in this scope
#[crate::my_macro] //~ ERROR can't use a procedural macro from the same crate that defines it
//~| ERROR expected attribute, found macro `crate::my_macro`
fn check_attr1() {}

View file

@ -76,15 +76,6 @@ error: can't use a procedural macro from the same crate that defines it
LL | #[derive(MyTrait)]
| ^^^^^^^
error[E0658]: The attribute `my_macro` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/macro-namespace-reserved-2.rs:38:3
|
LL | #[my_macro]
| ^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: can't use a procedural macro from the same crate that defines it
--> $DIR/macro-namespace-reserved-2.rs:39:3
|
@ -97,6 +88,12 @@ error: expected attribute, found macro `crate::my_macro`
LL | #[crate::my_macro]
| ^^^^^^^^^^^^^^^ not an attribute
error: cannot find attribute macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:38:3
|
LL | #[my_macro]
| ^^^^^^^^
error: cannot find derive macro `my_macro` in this scope
--> $DIR/macro-namespace-reserved-2.rs:48:10
|
@ -117,4 +114,3 @@ LL | MyTrait!();
error: aborting due to 19 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -4,7 +4,7 @@
extern crate derive_b;
#[B] //~ ERROR `B` is ambiguous
#[C] //~ ERROR attribute `C` is currently unknown to the compiler
#[C] //~ ERROR cannot find attribute macro `C` in this scope
#[B(D)] //~ ERROR `B` is ambiguous
#[B(E = "foo")] //~ ERROR `B` is ambiguous
#[B(arbitrary tokens)] //~ ERROR `B` is ambiguous

View file

@ -1,11 +1,8 @@
error[E0658]: The attribute `C` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `C` in this scope
--> $DIR/proc-macro-attributes.rs:7:3
|
LL | #[C]
| ^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
| ^ help: a derive helper attribute with a similar name exists: `B`
error[E0659]: `B` is ambiguous (derive helper attribute vs any other name)
--> $DIR/proc-macro-attributes.rs:6:3
@ -77,5 +74,4 @@ LL | #[macro_use]
error: aborting due to 5 previous errors
Some errors have detailed explanations: E0658, E0659.
For more information about an error, try `rustc --explain E0658`.
For more information about this error, try `rustc --explain E0659`.

View file

@ -24,11 +24,11 @@ macro_rules! attr_proc_mac {
struct Foo;
// Interpreted as a feature gated custom attribute
#[attr_proc_macra] //~ ERROR attribute `attr_proc_macra` is currently unknown
#[attr_proc_macra] //~ ERROR cannot find attribute macro `attr_proc_macra` in this scope
struct Bar;
// Interpreted as a feature gated custom attribute
#[FooWithLongNan] //~ ERROR attribute `FooWithLongNan` is currently unknown
#[FooWithLongNan] //~ ERROR cannot find attribute macro `FooWithLongNan` in this scope
struct Asdf;
#[derive(Dlone)]

View file

@ -1,38 +1,32 @@
error[E0658]: The attribute `attr_proc_macra` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/resolve-error.rs:27:3
|
LL | #[attr_proc_macra]
| ^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: The attribute `FooWithLongNan` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/resolve-error.rs:31:3
|
LL | #[FooWithLongNan]
| ^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: cannot find derive macro `FooWithLongNan` in this scope
--> $DIR/resolve-error.rs:22:10
|
LL | #[derive(FooWithLongNan)]
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
| ^^^^^^^^^^^^^^ help: a derive macro with a similar name exists: `FooWithLongName`
error: cannot find attribute macro `attr_proc_macra` in this scope
--> $DIR/resolve-error.rs:27:3
|
LL | #[attr_proc_macra]
| ^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `attr_proc_macro`
error: cannot find attribute macro `FooWithLongNan` in this scope
--> $DIR/resolve-error.rs:31:3
|
LL | #[FooWithLongNan]
| ^^^^^^^^^^^^^^
error: cannot find derive macro `Dlone` in this scope
--> $DIR/resolve-error.rs:34:10
|
LL | #[derive(Dlone)]
| ^^^^^ help: try: `Clone`
| ^^^^^ help: a derive macro with a similar name exists: `Clone`
error: cannot find derive macro `Dlona` in this scope
--> $DIR/resolve-error.rs:38:10
|
LL | #[derive(Dlona)]
| ^^^^^ help: try: `Clona`
| ^^^^^ help: a derive macro with a similar name exists: `Clona`
error: cannot find derive macro `attr_proc_macra` in this scope
--> $DIR/resolve-error.rs:42:10
@ -44,13 +38,13 @@ error: cannot find macro `FooWithLongNama!` in this scope
--> $DIR/resolve-error.rs:47:5
|
LL | FooWithLongNama!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `FooWithLongNam`
| ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `FooWithLongNam`
error: cannot find macro `attr_proc_macra!` in this scope
--> $DIR/resolve-error.rs:50:5
|
LL | attr_proc_macra!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `attr_proc_mac`
| ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `attr_proc_mac`
error: cannot find macro `Dlona!` in this scope
--> $DIR/resolve-error.rs:53:5
@ -62,8 +56,7 @@ error: cannot find macro `bang_proc_macrp!` in this scope
--> $DIR/resolve-error.rs:56:5
|
LL | bang_proc_macrp!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
| ^^^^^^^^^^^^^^^ help: a macro with a similar name exists: `bang_proc_macro`
error: aborting due to 10 previous errors
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,5 +1,5 @@
#[rustc_attribute_should_be_reserved]
//~^ ERROR attribute `rustc_attribute_should_be_reserved` is currently unknown
//~^ ERROR cannot find attribute macro `rustc_attribute_should_be_reserved` in this scope
//~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
macro_rules! foo {

View file

@ -7,14 +7,11 @@ LL | #[rustc_attribute_should_be_reserved]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error[E0658]: The attribute `rustc_attribute_should_be_reserved` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `rustc_attribute_should_be_reserved` in this scope
--> $DIR/reserved-attr-on-macro.rs:1:3
|
LL | #[rustc_attribute_should_be_reserved]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: cannot determine resolution for the macro `foo`
--> $DIR/reserved-attr-on-macro.rs:10:5

View file

@ -2,7 +2,7 @@ error[E0412]: cannot find type `esize` in this scope
--> $DIR/levenshtein.rs:5:11
|
LL | fn foo(c: esize) {} // Misspelled primitive type name.
| ^^^^^ help: a primitive type with a similar name exists: `isize`
| ^^^^^ help: a builtin type with a similar name exists: `isize`
error[E0412]: cannot find type `Baz` in this scope
--> $DIR/levenshtein.rs:10:10

View file

@ -1,9 +1,10 @@
// gate-test-custom_inner_attributes
#[foo] //~ ERROR is currently unknown to the compiler
#![feature(custom_attribute)]
#[foo]
mod foo {
#![foo] //~ ERROR is currently unknown to the compiler
//~| ERROR non-builtin inner attributes are unstable
#![foo] //~ ERROR non-builtin inner attributes are unstable
}
fn main() {}

View file

@ -1,14 +1,5 @@
error[E0658]: The attribute `foo` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/issue-36530.rs:3:3
|
LL | #[foo]
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error[E0658]: non-builtin inner attributes are unstable
--> $DIR/issue-36530.rs:5:5
--> $DIR/issue-36530.rs:7:5
|
LL | #![foo]
| ^^^^^^^
@ -16,15 +7,6 @@ LL | #![foo]
= note: for more information, see https://github.com/rust-lang/rust/issues/54726
= help: add `#![feature(custom_inner_attributes)]` 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
--> $DIR/issue-36530.rs:5:8
|
LL | #![foo]
| ^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 3 previous errors
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.

View file

@ -1,11 +1,11 @@
#[deprcated] //~ ERROR attribute `deprcated` is currently unknown
#[deprcated] //~ ERROR cannot find attribute macro `deprcated` in this scope
fn foo() {}
#[tests] //~ ERROR attribute `tests` is currently unknown to the compiler
#[tests] //~ ERROR cannot find attribute macro `tests` in this scope
fn bar() {}
#[rustc_err]
//~^ ERROR attribute `rustc_err` is currently unknown
//~^ ERROR cannot find attribute macro `rustc_err` in this scope
//~| ERROR attributes starting with `rustc` are reserved for use by the `rustc` compiler
fn main() {}

View file

@ -7,32 +7,23 @@ LL | #[rustc_err]
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error[E0658]: The attribute `rustc_err` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `rustc_err` in this scope
--> $DIR/attribute-typos.rs:7:3
|
LL | #[rustc_err]
| ^^^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `rustc_error`
error[E0658]: The attribute `tests` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `tests` in this scope
--> $DIR/attribute-typos.rs:4:3
|
LL | #[tests]
| ^^^^^ help: a built-in attribute with a similar name exists: `test`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
| ^^^^^ help: an attribute macro with a similar name exists: `test`
error[E0658]: The attribute `deprcated` is currently unknown to the compiler and may have meaning added to it in the future
error: cannot find attribute macro `deprcated` in this scope
--> $DIR/attribute-typos.rs:1:3
|
LL | #[deprcated]
| ^^^^^^^^^ help: a built-in attribute with a similar name exists: `deprecated`
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: aborting due to 4 previous errors

View file

@ -5,7 +5,7 @@ type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::
struct S;
// Interpreted as a feature gated custom attribute
#[rustfmt] //~ ERROR attribute `rustfmt` is currently unknown
#[rustfmt] //~ ERROR cannot find attribute macro `rustfmt` in this scope
fn check() {}
#[rustfmt::skip] // OK

View file

@ -1,18 +1,15 @@
error[E0658]: The attribute `rustfmt` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/tool-attributes-misplaced-1.rs:8:3
|
LL | #[rustfmt]
| ^^^^^^^
|
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
= help: add `#![feature(custom_attribute)]` to the crate attributes to enable
error: cannot find derive macro `rustfmt` in this scope
--> $DIR/tool-attributes-misplaced-1.rs:4:10
|
LL | #[derive(rustfmt)]
| ^^^^^^^
error: cannot find attribute macro `rustfmt` in this scope
--> $DIR/tool-attributes-misplaced-1.rs:8:3
|
LL | #[rustfmt]
| ^^^^^^^
error: cannot find macro `rustfmt!` in this scope
--> $DIR/tool-attributes-misplaced-1.rs:14:5
|
@ -45,5 +42,4 @@ LL | rustfmt::skip;
error: aborting due to 7 previous errors
Some errors have detailed explanations: E0423, E0658.
For more information about an error, try `rustc --explain E0423`.
For more information about this error, try `rustc --explain E0423`.