forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#60908 - GuillaumeGomez:errors, r=oli-obk
Fix lints handling in rustdoc Part of rust-lang#60664: now lints are handled just like any other lints you would setup in rustc. Still remains to handle `missing code examples` and `missing_docs` as part of the same group. r? @oli-obk
- Loading branch information
Showing
9 changed files
with
123 additions
and
25 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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#![deny(missing_docs)] | ||
#![deny(missing_doc_code_examples)] | ||
|
||
//! crate level doc | ||
//! ``` | ||
//! println!("hello"): | ||
//! ``` | ||
|
||
/// doc | ||
/// | ||
/// ``` | ||
/// println!("hello"); | ||
/// ``` | ||
fn test() { | ||
} | ||
|
||
#[allow(missing_docs)] | ||
mod module1 { //~ ERROR | ||
} | ||
|
||
#[allow(missing_doc_code_examples)] | ||
/// doc | ||
mod module2 { | ||
|
||
/// doc | ||
pub fn test() {} | ||
} | ||
|
||
/// doc | ||
/// | ||
/// ``` | ||
/// println!("hello"); | ||
/// ``` | ||
pub mod module3 { | ||
|
||
/// doc | ||
//~^ ERROR | ||
pub fn test() {} | ||
} |
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,21 @@ | ||
error: Missing code example in this documentation | ||
--> $DIR/lint-missing-doc-code-example.rs:19:1 | ||
| | ||
LL | / mod module1 { | ||
LL | | } | ||
| |_^ | ||
| | ||
note: lint level defined here | ||
--> $DIR/lint-missing-doc-code-example.rs:2:9 | ||
| | ||
LL | #![deny(missing_doc_code_examples)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: Missing code example in this documentation | ||
--> $DIR/lint-missing-doc-code-example.rs:37:3 | ||
| | ||
LL | /// doc | ||
| ^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|