forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#130025 - Urgau:missing_docs-expect, r=petro…
…chenkov Also emit `missing_docs` lint with `--test` to fulfil expectations This PR removes the "test harness" suppression of the `missing_docs` lint to be able to fulfil `#[expect]` (expectations) as it is now "relevant". I think the goal was to maybe avoid false-positive while linting on public items under `#[cfg(test)]` but with effective visibility we should no longer have any false-positive. Another possibility would be to query the lint level and only emit the lint if it's of expect level, but that is even more hacky. Fixes rust-lang#130021
- Loading branch information
Showing
5 changed files
with
21 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Make sure that `#[expect(missing_docs)]` is always correctly fulfilled. | ||
|
||
//@ check-pass | ||
//@ revisions: lib bin test | ||
//@ [lib]compile-flags: --crate-type lib | ||
//@ [bin]compile-flags: --crate-type bin | ||
//@ [test]compile-flags: --test | ||
|
||
#[expect(missing_docs)] | ||
pub fn foo() {} | ||
|
||
#[cfg(bin)] | ||
fn main() {} |