-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #111505 - GuillaumeGomez:turn-invalid-doc-attr-into-e…
…rr, r=rustdoc Made `INVALID_DOC_ATTRIBUTES` lint deny by default Fixes #82730. # Explanations The `INVALID_DOC_ATTRIBUTES` lint was marked as "will become a hard error into the future" for quite some time so making it `deny` by default. <del>Waiting on rust-lang/backtrace-rs#524 for now.</del>
- Loading branch information
Showing
28 changed files
with
56 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
//@ check-pass | ||
|
||
#[doc(include = "external-cross-doc.md")] | ||
//~^ WARNING unknown `doc` attribute `include` | ||
//~^ ERROR unknown `doc` attribute `include` | ||
//~| HELP use `doc = include_str!` instead | ||
// FIXME(#85497): make this a deny instead so it's more clear what's happening | ||
//~| NOTE on by default | ||
//~| WARNING previously accepted | ||
//~| NOTE see issue #82730 | ||
pub struct NeedMoreDocs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
warning: unknown `doc` attribute `include` | ||
--> $DIR/doc-include-suggestion.rs:3:7 | ||
error: unknown `doc` attribute `include` | ||
--> $DIR/doc-include-suggestion.rs:1:7 | ||
| | ||
LL | #[doc(include = "external-cross-doc.md")] | ||
| ------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-- help: use `doc = include_str!` instead: `#[doc = include_str!("external-cross-doc.md")]` | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
= note: `#[warn(invalid_doc_attributes)]` on by default | ||
= note: `#[deny(invalid_doc_attributes)]` on by default | ||
|
||
warning: 1 warning emitted | ||
error: aborting due to 1 previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
#![crate_type = "lib"] | ||
#![deny(invalid_doc_attributes)] | ||
|
||
#![doc(test)] | ||
//~^ ERROR `#[doc(test(...)]` takes a list of attributes | ||
//~^^ WARN this was previously accepted by the compiler | ||
#![doc(test = "hello")] | ||
//~^ ERROR `#[doc(test(...)]` takes a list of attributes | ||
//~^^ WARN this was previously accepted by the compiler | ||
#![doc(test(a))] | ||
//~^ ERROR unknown `doc(test)` attribute `a` | ||
//~^^ WARN this was previously accepted by the compiler | ||
|
||
pub fn foo() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,22 @@ | ||
error: `#[doc(test(...)]` takes a list of attributes | ||
--> $DIR/doc-test-attr.rs:4:8 | ||
--> $DIR/doc-test-attr.rs:3:8 | ||
| | ||
LL | #![doc(test)] | ||
| ^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
note: the lint level is defined here | ||
--> $DIR/doc-test-attr.rs:2:9 | ||
| | ||
LL | #![deny(invalid_doc_attributes)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
= note: `#[deny(invalid_doc_attributes)]` on by default | ||
|
||
error: `#[doc(test(...)]` takes a list of attributes | ||
--> $DIR/doc-test-attr.rs:7:8 | ||
--> $DIR/doc-test-attr.rs:5:8 | ||
| | ||
LL | #![doc(test = "hello")] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: unknown `doc(test)` attribute `a` | ||
--> $DIR/doc-test-attr.rs:10:13 | ||
--> $DIR/doc-test-attr.rs:7:13 | ||
| | ||
LL | #![doc(test(a))] | ||
| ^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,17 @@ | ||
#![crate_type = "lib"] | ||
#![deny(warnings)] | ||
#![doc(as_ptr)] | ||
//~^ ERROR unknown `doc` attribute | ||
//~^^ WARN | ||
|
||
#[doc(as_ptr)] | ||
//~^ ERROR unknown `doc` attribute | ||
//~^^ WARN | ||
pub fn foo() {} | ||
|
||
#[doc(123)] | ||
//~^ ERROR invalid `doc` attribute | ||
//~| WARN | ||
#[doc("hello", "bar")] | ||
//~^ ERROR invalid `doc` attribute | ||
//~| WARN | ||
//~| ERROR invalid `doc` attribute | ||
//~| WARN | ||
#[doc(foo::bar, crate::bar::baz = "bye")] | ||
//~^ ERROR unknown `doc` attribute | ||
//~| WARN | ||
//~| ERROR unknown `doc` attribute | ||
//~| WARN | ||
fn bar() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,46 @@ | ||
error: unknown `doc` attribute `as_ptr` | ||
--> $DIR/doc-attr.rs:7:7 | ||
--> $DIR/doc-attr.rs:5:7 | ||
| | ||
LL | #[doc(as_ptr)] | ||
| ^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
note: the lint level is defined here | ||
--> $DIR/doc-attr.rs:2:9 | ||
| | ||
LL | #![deny(warnings)] | ||
| ^^^^^^^^ | ||
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]` | ||
= note: `#[deny(invalid_doc_attributes)]` on by default | ||
|
||
error: invalid `doc` attribute | ||
--> $DIR/doc-attr.rs:12:7 | ||
--> $DIR/doc-attr.rs:9:7 | ||
| | ||
LL | #[doc(123)] | ||
| ^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: invalid `doc` attribute | ||
--> $DIR/doc-attr.rs:15:7 | ||
--> $DIR/doc-attr.rs:11:7 | ||
| | ||
LL | #[doc("hello", "bar")] | ||
| ^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: invalid `doc` attribute | ||
--> $DIR/doc-attr.rs:15:16 | ||
--> $DIR/doc-attr.rs:11:16 | ||
| | ||
LL | #[doc("hello", "bar")] | ||
| ^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: unknown `doc` attribute `foo::bar` | ||
--> $DIR/doc-attr.rs:20:7 | ||
--> $DIR/doc-attr.rs:14:7 | ||
| | ||
LL | #[doc(foo::bar, crate::bar::baz = "bye")] | ||
| ^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: unknown `doc` attribute `crate::bar::baz` | ||
--> $DIR/doc-attr.rs:20:17 | ||
--> $DIR/doc-attr.rs:14:17 | ||
| | ||
LL | #[doc(foo::bar, crate::bar::baz = "bye")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: unknown `doc` attribute `as_ptr` | ||
--> $DIR/doc-attr.rs:3:8 | ||
--> $DIR/doc-attr.rs:2:8 | ||
| | ||
LL | #![doc(as_ptr)] | ||
| ^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: aborting due to 7 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
//@ run-rustfix | ||
#![deny(warnings)] | ||
#![feature(doc_notable_trait)] | ||
|
||
#[doc(notable_trait)] | ||
//~^ ERROR unknown `doc` attribute `spotlight` | ||
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
trait MyTrait {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
//@ run-rustfix | ||
#![deny(warnings)] | ||
#![feature(doc_notable_trait)] | ||
|
||
#[doc(spotlight)] | ||
//~^ ERROR unknown `doc` attribute `spotlight` | ||
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
trait MyTrait {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
error: unknown `doc` attribute `spotlight` | ||
--> $DIR/doc-spotlight.rs:5:7 | ||
--> $DIR/doc-spotlight.rs:4:7 | ||
| | ||
LL | #[doc(spotlight)] | ||
| ^^^^^^^^^ help: use `notable_trait` instead | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
= note: `doc(spotlight)` was renamed to `doc(notable_trait)` | ||
= note: `doc(spotlight)` is now a no-op | ||
note: the lint level is defined here | ||
--> $DIR/doc-spotlight.rs:2:9 | ||
| | ||
LL | #![deny(warnings)] | ||
| ^^^^^^^^ | ||
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]` | ||
= note: `#[deny(invalid_doc_attributes)]` on by default | ||
|
||
error: aborting due to 1 previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
#![feature(doc_cfg_hide)] | ||
#![deny(warnings)] | ||
|
||
#![doc(cfg_hide = "test")] //~ ERROR | ||
//~^ WARN | ||
#![doc(cfg_hide)] //~ ERROR | ||
//~^ WARN | ||
|
||
#[doc(cfg_hide(doc))] //~ ERROR | ||
//~^ WARN | ||
pub fn foo() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,27 @@ | ||
error: this attribute can only be applied at the crate level | ||
--> $DIR/doc_cfg_hide.rs:9:7 | ||
--> $DIR/doc_cfg_hide.rs:6:7 | ||
| | ||
LL | #[doc(cfg_hide(doc))] | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
= note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information | ||
note: the lint level is defined here | ||
--> $DIR/doc_cfg_hide.rs:2:9 | ||
| | ||
LL | #![deny(warnings)] | ||
| ^^^^^^^^ | ||
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]` | ||
= note: `#[deny(invalid_doc_attributes)]` on by default | ||
help: to apply to the crate, use an inner attribute | ||
| | ||
LL | #![doc(cfg_hide(doc))] | ||
| + | ||
|
||
error: `#[doc(cfg_hide(...))]` takes a list of attributes | ||
--> $DIR/doc_cfg_hide.rs:4:8 | ||
--> $DIR/doc_cfg_hide.rs:3:8 | ||
| | ||
LL | #![doc(cfg_hide = "test")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: `#[doc(cfg_hide(...))]` takes a list of attributes | ||
--> $DIR/doc_cfg_hide.rs:6:8 | ||
--> $DIR/doc_cfg_hide.rs:4:8 | ||
| | ||
LL | #![doc(cfg_hide)] | ||
| ^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730> | ||
|
||
error: aborting due to 3 previous errors | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.