File tree 7 files changed +39
-11
lines changed
compiler/rustc_lint_defs/src
7 files changed +39
-11
lines changed Original file line number Diff line number Diff line change @@ -2994,6 +2994,7 @@ declare_lint_pass! {
2994
2994
USELESS_DEPRECATED ,
2995
2995
UNSUPPORTED_NAKED_FUNCTIONS ,
2996
2996
MISSING_ABI ,
2997
+ INVALID_DOC_ATTRIBUTES ,
2997
2998
SEMICOLON_IN_EXPRESSIONS_FROM_MACROS ,
2998
2999
DISJOINT_CAPTURE_MIGRATION ,
2999
3000
LEGACY_DERIVE_HELPERS ,
Original file line number Diff line number Diff line change @@ -217,8 +217,9 @@ crate fn create_config(
217
217
// By default, rustdoc ignores all lints.
218
218
// Specifically unblock lints relevant to documentation or the lint machinery itself.
219
219
let mut lints_to_show = vec ! [
220
- // it's unclear whether this should be part of rustdoc directly (#77364)
220
+ // it's unclear whether these should be part of rustdoc directly (#77364)
221
221
rustc_lint:: builtin:: MISSING_DOCS . name. to_string( ) ,
222
+ rustc_lint:: builtin:: INVALID_DOC_ATTRIBUTES . name. to_string( ) ,
222
223
// these are definitely not part of rustdoc, but we want to warn on them anyway.
223
224
rustc_lint:: builtin:: RENAMED_AND_REMOVED_LINTS . name. to_string( ) ,
224
225
rustc_lint:: builtin:: UNKNOWN_LINTS . name. to_string( ) ,
Original file line number Diff line number Diff line change 1
- // check-pass
2
1
// run-rustfix
3
-
2
+ #![deny(warnings)]
4
3
#![feature(doc_notable_trait)]
5
4
6
5
#[doc(notable_trait)]
7
- //~^ WARN unknown `doc` attribute `spotlight`
6
+ //~^ ERROR unknown `doc` attribute `spotlight`
8
7
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
8
trait MyTrait {}
Original file line number Diff line number Diff line change 1
- // check-pass
2
1
// run-rustfix
3
-
2
+ #! [ deny ( warnings ) ]
4
3
#![ feature( doc_notable_trait) ]
5
4
6
5
#[ doc( spotlight) ]
7
- //~^ WARN unknown `doc` attribute `spotlight`
6
+ //~^ ERROR unknown `doc` attribute `spotlight`
8
7
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
8
trait MyTrait { }
Original file line number Diff line number Diff line change 1
- warning : unknown `doc` attribute `spotlight`
2
- --> $DIR/doc-spotlight.rs:6 :7
1
+ error : unknown `doc` attribute `spotlight`
2
+ --> $DIR/doc-spotlight.rs:5 :7
3
3
|
4
4
LL | #[doc(spotlight)]
5
5
| ^^^^^^^^^ help: use `notable_trait` instead
6
6
|
7
- = note: `#[warn(invalid_doc_attributes)]` on by default
7
+ note: the lint level is defined here
8
+ --> $DIR/doc-spotlight.rs:2:9
9
+ |
10
+ LL | #![deny(warnings)]
11
+ | ^^^^^^^^
12
+ = note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
8
13
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
9
14
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
10
15
= note: `doc(spotlight)` was renamed to `doc(notable_trait)`
11
16
= note: `doc(spotlight)` is now a no-op
12
17
13
- warning: 1 warning emitted
18
+ error: aborting due to previous error
14
19
Original file line number Diff line number Diff line change
1
+ #![ deny( invalid_doc_attributes) ]
2
+ //~^ NOTE defined here
3
+ #![ doc( x) ]
4
+ //~^ ERROR unknown `doc` attribute `x`
5
+ //~| WARNING will become a hard error
6
+ //~| NOTE see issue #82730
7
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error: unknown `doc` attribute `x`
2
+ --> $DIR/deny-invalid-doc-attrs.rs:3:8
3
+ |
4
+ LL | #![doc(x)]
5
+ | ^
6
+ |
7
+ note: the lint level is defined here
8
+ --> $DIR/deny-invalid-doc-attrs.rs:1:9
9
+ |
10
+ LL | #![deny(invalid_doc_attributes)]
11
+ | ^^^^^^^^^^^^^^^^^^^^^^
12
+ = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
13
+ = note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
14
+
15
+ error: aborting due to previous error
16
+
You can’t perform that action at this time.
0 commit comments