Also emit missing_docs lint with --test to fulfill expectations
This commit is contained in:
@@ -426,12 +426,6 @@ impl MissingDoc {
|
|||||||
article: &'static str,
|
article: &'static str,
|
||||||
desc: &'static str,
|
desc: &'static str,
|
||||||
) {
|
) {
|
||||||
// If we're building a test harness, then warning about
|
|
||||||
// documentation is probably not really relevant right now.
|
|
||||||
if cx.sess().opts.test {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only check publicly-visible items, using the result from the privacy pass.
|
// Only check publicly-visible items, using the result from the privacy pass.
|
||||||
// It's an option so the crate root can also use this function (it doesn't
|
// It's an option so the crate root can also use this function (it doesn't
|
||||||
// have a `NodeId`).
|
// have a `NodeId`).
|
||||||
|
|||||||
13
tests/ui/lint/lint-missing-doc-expect.rs
Normal file
13
tests/ui/lint/lint-missing-doc-expect.rs
Normal file
@@ -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() {}
|
||||||
Reference in New Issue
Block a user