Remove some more #![feature(custom_attribute)]s

This commit is contained in:
Vadim Petrochenkov 2019-06-08 17:35:54 +03:00
parent ea4ad555d7
commit 6a66491883
9 changed files with 96 additions and 70 deletions

View File

@ -728,19 +728,17 @@ This lint detects attributes that were not used by the compiler. Some
example code that triggers this lint:
```rust
#![feature(custom_attribute)]
#![mutable_doc]
#![macro_export]
```
This will produce:
```text
warning: unused attribute
--> src/main.rs:4:1
--> src/main.rs:1:1
|
4 | #![mutable_doc]
| ^^^^^^^^^^^^^^^
1 | #![macro_export]
| ^^^^^^^^^^^^^^^^
|
```

View File

@ -1,12 +1,8 @@
// When denying at the crate level, be sure to not get random warnings from the
// injected intrinsics by the compiler.
#![deny(unused_attributes)]
#![allow(dead_code)]
#![feature(custom_attribute)]
#[ab_isize="stdcall"] extern {} //~ ERROR attribute `ab_isize` is currently unknown
#[ab_isize="stdcall"] extern {} //~ ERROR unused attribute
#[fixed_stack_segment] fn f() {} //~ ERROR unused attribute
#[fixed_stack_segment] fn f() {} //~ ERROR attribute `fixed_stack_segment` is currently unknown
fn main() {}

View File

@ -1,20 +1,21 @@
error: unused attribute
--> $DIR/lint-obsolete-attr.rs:8:1
|
LL | #[ab_isize="stdcall"] extern {}
| ^^^^^^^^^^^^^^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-obsolete-attr.rs:4:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/lint-obsolete-attr.rs:10:1
error[E0658]: The attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/lint-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
--> $DIR/lint-obsolete-attr.rs:4: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

@ -1,11 +1,10 @@
// When denying at the crate level, be sure to not get random warnings from the
// injected intrinsics by the compiler.
#![feature(custom_attribute)]
#![deny(unused_attributes)]
#![feature(custom_inner_attributes)]
#![mutable_doc] //~ ERROR unused attribute
#![mutable_doc] //~ ERROR attribute `mutable_doc` is currently unknown
#[dance] mod a {} //~ ERROR unused attribute
#[dance] mod a {} //~ ERROR attribute `dance` is currently unknown
#[dance] fn main() {} //~ ERROR unused attribute
#[dance] fn main() {} //~ ERROR attribute `dance` is currently unknown

View File

@ -1,26 +1,30 @@
error: unused attribute
--> $DIR/lint-unknown-attr.rs:9:1
|
LL | #[dance] mod a {}
| ^^^^^^^^
|
note: lint level defined here
--> $DIR/lint-unknown-attr.rs:5:9
|
LL | #![deny(unused_attributes)]
| ^^^^^^^^^^^^^^^^^
error: unused attribute
--> $DIR/lint-unknown-attr.rs:11:1
|
LL | #[dance] fn main() {}
| ^^^^^^^^
error: unused attribute
--> $DIR/lint-unknown-attr.rs:7:1
error[E0658]: The attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
--> $DIR/lint-unknown-attr.rs:6: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/lint-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/lint-unknown-attr.rs:10: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

@ -2,8 +2,6 @@
// aux-build:derive-clona.rs
// aux-build:test-macros.rs
#![feature(custom_attribute)]
#[macro_use]
extern crate derive_foo;
#[macro_use]
@ -25,10 +23,12 @@ macro_rules! attr_proc_mac {
//~^ ERROR cannot find
struct Foo;
#[attr_proc_macra] // OK, interpreted as a custom attribute
// Interpreted as a feature gated custom attribute
#[attr_proc_macra] //~ ERROR attribute `attr_proc_macra` is currently unknown
struct Bar;
#[FooWithLongNan] // OK, interpreted as a custom attribute
// Interpreted as a feature gated custom attribute
#[FooWithLongNan] //~ ERROR attribute `FooWithLongNan` is currently unknown
struct Asdf;
#[derive(Dlone)]

View File

@ -1,5 +1,23 @@
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:24:10
--> $DIR/resolve-error.rs:22:10
|
LL | #[derive(FooWithLongNan)]
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
@ -46,5 +64,6 @@ error: cannot find macro `bang_proc_macrp!` in this scope
LL | bang_proc_macrp!();
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
error: aborting due to 8 previous errors
error: aborting due to 10 previous errors
For more information about this error, try `rustc --explain E0658`.

View File

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

View File

@ -1,39 +1,49 @@
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:6:10
--> $DIR/tool-attributes-misplaced-1.rs:4:10
|
LL | #[derive(rustfmt)]
| ^^^^^^^
error: cannot find macro `rustfmt!` in this scope
--> $DIR/tool-attributes-misplaced-1.rs:15:5
--> $DIR/tool-attributes-misplaced-1.rs:14:5
|
LL | rustfmt!();
| ^^^^^^^
error[E0573]: expected type, found tool module `rustfmt`
--> $DIR/tool-attributes-misplaced-1.rs:3:10
--> $DIR/tool-attributes-misplaced-1.rs:1:10
|
LL | type A = rustfmt;
| ^^^^^^^ not a type
error[E0573]: expected type, found tool attribute `rustfmt::skip`
--> $DIR/tool-attributes-misplaced-1.rs:4:10
--> $DIR/tool-attributes-misplaced-1.rs:2:10
|
LL | type B = rustfmt::skip;
| ^^^^^^^^^^^^^ not a type
error[E0423]: expected value, found tool module `rustfmt`
--> $DIR/tool-attributes-misplaced-1.rs:14:5
--> $DIR/tool-attributes-misplaced-1.rs:13:5
|
LL | rustfmt;
| ^^^^^^^ not a value
error[E0423]: expected value, found tool attribute `rustfmt::skip`
--> $DIR/tool-attributes-misplaced-1.rs:17:5
--> $DIR/tool-attributes-misplaced-1.rs:16:5
|
LL | rustfmt::skip;
| ^^^^^^^^^^^^^ not a value
error: aborting due to 6 previous errors
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0423`.
Some errors have detailed explanations: E0423, E0658.
For more information about an error, try `rustc --explain E0423`.