-
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.
Auto merge of #79613 - GuillaumeGomez:doc-keyword-checks, r=oli-obk
Add checks for #[doc(keyword = "...")] attribute The goal here is to extend check for `#[doc(keyword = "...")]`. cc `@jyn514` r? `@oli-obk`
- Loading branch information
Showing
10 changed files
with
194 additions
and
106 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
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
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
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,8 +1,14 @@ | ||
error: '\'' character isn't allowed in `#[doc(alias = "...")]` | ||
--> $DIR/doc-alias-crate-level.rs:7:16 | ||
--> $DIR/doc-alias-crate-level.rs:9:15 | ||
| | ||
LL | #![doc(alias = "shouldn't work!")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
LL | #[doc(alias = "shouldn't work!")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
error: `#![doc(alias = "...")]` isn't allowed as a crate level attribute | ||
--> $DIR/doc-alias-crate-level.rs:7:8 | ||
| | ||
LL | #![doc(alias = "not working!")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#![crate_type = "lib"] | ||
#![feature(doc_keyword)] | ||
|
||
#![doc(keyword = "hello")] //~ ERROR | ||
|
||
#[doc(keyword = "hell")] //~ ERROR | ||
mod foo { | ||
fn hell() {} | ||
} | ||
|
||
#[doc(keyword = "hall")] //~ ERROR | ||
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: `#[doc(keyword = "...")]` can only be used on empty modules | ||
--> $DIR/doc_keyword.rs:6:7 | ||
| | ||
LL | #[doc(keyword = "hell")] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `#[doc(keyword = "...")]` can only be used on modules | ||
--> $DIR/doc_keyword.rs:11:7 | ||
| | ||
LL | #[doc(keyword = "hall")] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: `#![doc(keyword = "...")]` isn't allowed as a crate level attribute | ||
--> $DIR/doc_keyword.rs:4:8 | ||
| | ||
LL | #![doc(keyword = "hello")] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|