Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6a66491

Browse files
committed
Remove some more #![feature(custom_attribute)]s
1 parent ea4ad55 commit 6a66491

File tree

9 files changed

+89
-63
lines changed

9 files changed

+89
-63
lines changed

src/doc/rustc/src/lints/listing/warn-by-default.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -728,19 +728,17 @@ This lint detects attributes that were not used by the compiler. Some
728728
example code that triggers this lint:
729729

730730
```rust
731-
#![feature(custom_attribute)]
732-
733-
#![mutable_doc]
731+
#![macro_export]
734732
```
735733

736734
This will produce:
737735

738736
```text
739737
warning: unused attribute
740-
--> src/main.rs:4:1
738+
--> src/main.rs:1:1
741739
|
742-
4 | #![mutable_doc]
743-
| ^^^^^^^^^^^^^^^
740+
1 | #![macro_export]
741+
| ^^^^^^^^^^^^^^^^
744742
|
745743
```
746744

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// When denying at the crate level, be sure to not get random warnings from the
22
// injected intrinsics by the compiler.
33

4-
#![deny(unused_attributes)]
5-
#![allow(dead_code)]
6-
#![feature(custom_attribute)]
4+
#[ab_isize="stdcall"] extern {} //~ ERROR attribute `ab_isize` is currently unknown
75

8-
#[ab_isize="stdcall"] extern {} //~ ERROR unused attribute
9-
10-
#[fixed_stack_segment] fn f() {} //~ ERROR unused attribute
6+
#[fixed_stack_segment] fn f() {} //~ ERROR attribute `fixed_stack_segment` is currently unknown
117

128
fn main() {}
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
error: unused attribute
2-
--> $DIR/lint-obsolete-attr.rs:8:1
1+
error[E0658]: The attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
2+
--> $DIR/lint-obsolete-attr.rs:6:3
33
|
4-
LL | #[ab_isize="stdcall"] extern {}
5-
| ^^^^^^^^^^^^^^^^^^^^^
6-
|
7-
note: lint level defined here
8-
--> $DIR/lint-obsolete-attr.rs:4:9
4+
LL | #[fixed_stack_segment] fn f() {}
5+
| ^^^^^^^^^^^^^^^^^^^
96
|
10-
LL | #![deny(unused_attributes)]
11-
| ^^^^^^^^^^^^^^^^^
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
8+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
129

13-
error: unused attribute
14-
--> $DIR/lint-obsolete-attr.rs:10:1
10+
error[E0658]: The attribute `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
11+
--> $DIR/lint-obsolete-attr.rs:4:3
1512
|
16-
LL | #[fixed_stack_segment] fn f() {}
17-
| ^^^^^^^^^^^^^^^^^^^^^^
13+
LL | #[ab_isize="stdcall"] extern {}
14+
| ^^^^^^^^
15+
|
16+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
17+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
1818

1919
error: aborting due to 2 previous errors
2020

21+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/lint/lint-unknown-attr.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// When denying at the crate level, be sure to not get random warnings from the
22
// injected intrinsics by the compiler.
33

4-
#![feature(custom_attribute)]
5-
#![deny(unused_attributes)]
4+
#![feature(custom_inner_attributes)]
65

7-
#![mutable_doc] //~ ERROR unused attribute
6+
#![mutable_doc] //~ ERROR attribute `mutable_doc` is currently unknown
87

9-
#[dance] mod a {} //~ ERROR unused attribute
8+
#[dance] mod a {} //~ ERROR attribute `dance` is currently unknown
109

11-
#[dance] fn main() {} //~ ERROR unused attribute
10+
#[dance] fn main() {} //~ ERROR attribute `dance` is currently unknown
Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
error: unused attribute
2-
--> $DIR/lint-unknown-attr.rs:9:1
1+
error[E0658]: The attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
2+
--> $DIR/lint-unknown-attr.rs:6:4
33
|
4-
LL | #[dance] mod a {}
5-
| ^^^^^^^^
4+
LL | #![mutable_doc]
5+
| ^^^^^^^^^^^
66
|
7-
note: lint level defined here
8-
--> $DIR/lint-unknown-attr.rs:5:9
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
8+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
9+
10+
error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
11+
--> $DIR/lint-unknown-attr.rs:8:3
912
|
10-
LL | #![deny(unused_attributes)]
11-
| ^^^^^^^^^^^^^^^^^
13+
LL | #[dance] mod a {}
14+
| ^^^^^
15+
|
16+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
17+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
1218

13-
error: unused attribute
14-
--> $DIR/lint-unknown-attr.rs:11:1
19+
error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
20+
--> $DIR/lint-unknown-attr.rs:10:3
1521
|
1622
LL | #[dance] fn main() {}
17-
| ^^^^^^^^
18-
19-
error: unused attribute
20-
--> $DIR/lint-unknown-attr.rs:7:1
23+
| ^^^^^
2124
|
22-
LL | #![mutable_doc]
23-
| ^^^^^^^^^^^^^^^
25+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
26+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
2427

2528
error: aborting due to 3 previous errors
2629

30+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/proc-macro/resolve-error.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// aux-build:derive-clona.rs
33
// aux-build:test-macros.rs
44

5-
#![feature(custom_attribute)]
6-
75
#[macro_use]
86
extern crate derive_foo;
97
#[macro_use]
@@ -25,10 +23,12 @@ macro_rules! attr_proc_mac {
2523
//~^ ERROR cannot find
2624
struct Foo;
2725

28-
#[attr_proc_macra] // OK, interpreted as a custom attribute
26+
// Interpreted as a feature gated custom attribute
27+
#[attr_proc_macra] //~ ERROR attribute `attr_proc_macra` is currently unknown
2928
struct Bar;
3029

31-
#[FooWithLongNan] // OK, interpreted as a custom attribute
30+
// Interpreted as a feature gated custom attribute
31+
#[FooWithLongNan] //~ ERROR attribute `FooWithLongNan` is currently unknown
3232
struct Asdf;
3333

3434
#[derive(Dlone)]

src/test/ui/proc-macro/resolve-error.stderr

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
1+
error[E0658]: The attribute `attr_proc_macra` is currently unknown to the compiler and may have meaning added to it in the future
2+
--> $DIR/resolve-error.rs:27:3
3+
|
4+
LL | #[attr_proc_macra]
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
8+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
9+
10+
error[E0658]: The attribute `FooWithLongNan` is currently unknown to the compiler and may have meaning added to it in the future
11+
--> $DIR/resolve-error.rs:31:3
12+
|
13+
LL | #[FooWithLongNan]
14+
| ^^^^^^^^^^^^^^
15+
|
16+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
17+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
18+
119
error: cannot find derive macro `FooWithLongNan` in this scope
2-
--> $DIR/resolve-error.rs:24:10
20+
--> $DIR/resolve-error.rs:22:10
321
|
422
LL | #[derive(FooWithLongNan)]
523
| ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
@@ -46,5 +64,6 @@ error: cannot find macro `bang_proc_macrp!` in this scope
4664
LL | bang_proc_macrp!();
4765
| ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
4866

49-
error: aborting due to 8 previous errors
67+
error: aborting due to 10 previous errors
5068

69+
For more information about this error, try `rustc --explain E0658`.

src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
#![feature(custom_attribute)]
2-
31
type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
42
type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
53

64
#[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
75
struct S;
86

9-
#[rustfmt] // OK, interpreted as a custom attribute
7+
// Interpreted as a feature gated custom attribute
8+
#[rustfmt] //~ ERROR attribute `rustfmt` is currently unknown
109
fn check() {}
1110

1211
#[rustfmt::skip] // OK
Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
1+
error[E0658]: The attribute `rustfmt` is currently unknown to the compiler and may have meaning added to it in the future
2+
--> $DIR/tool-attributes-misplaced-1.rs:8:3
3+
|
4+
LL | #[rustfmt]
5+
| ^^^^^^^
6+
|
7+
= note: for more information, see https://github.com/rust-lang/rust/issues/29642
8+
= help: add #![feature(custom_attribute)] to the crate attributes to enable
9+
110
error: cannot find derive macro `rustfmt` in this scope
2-
--> $DIR/tool-attributes-misplaced-1.rs:6:10
11+
--> $DIR/tool-attributes-misplaced-1.rs:4:10
312
|
413
LL | #[derive(rustfmt)]
514
| ^^^^^^^
615

716
error: cannot find macro `rustfmt!` in this scope
8-
--> $DIR/tool-attributes-misplaced-1.rs:15:5
17+
--> $DIR/tool-attributes-misplaced-1.rs:14:5
918
|
1019
LL | rustfmt!();
1120
| ^^^^^^^
1221

1322
error[E0573]: expected type, found tool module `rustfmt`
14-
--> $DIR/tool-attributes-misplaced-1.rs:3:10
23+
--> $DIR/tool-attributes-misplaced-1.rs:1:10
1524
|
1625
LL | type A = rustfmt;
1726
| ^^^^^^^ not a type
1827

1928
error[E0573]: expected type, found tool attribute `rustfmt::skip`
20-
--> $DIR/tool-attributes-misplaced-1.rs:4:10
29+
--> $DIR/tool-attributes-misplaced-1.rs:2:10
2130
|
2231
LL | type B = rustfmt::skip;
2332
| ^^^^^^^^^^^^^ not a type
2433

2534
error[E0423]: expected value, found tool module `rustfmt`
26-
--> $DIR/tool-attributes-misplaced-1.rs:14:5
35+
--> $DIR/tool-attributes-misplaced-1.rs:13:5
2736
|
2837
LL | rustfmt;
2938
| ^^^^^^^ not a value
3039

3140
error[E0423]: expected value, found tool attribute `rustfmt::skip`
32-
--> $DIR/tool-attributes-misplaced-1.rs:17:5
41+
--> $DIR/tool-attributes-misplaced-1.rs:16:5
3342
|
3443
LL | rustfmt::skip;
3544
| ^^^^^^^^^^^^^ not a value
3645

37-
error: aborting due to 6 previous errors
46+
error: aborting due to 7 previous errors
3847

39-
For more information about this error, try `rustc --explain E0423`.
48+
Some errors have detailed explanations: E0423, E0658.
49+
For more information about an error, try `rustc --explain E0423`.

0 commit comments

Comments
 (0)