mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Also emit missing_docs
lint with --test
to fulfill expectations
This commit is contained in:
parent
eb33b43bab
commit
7dd1be1d0d
@ -426,12 +426,6 @@ impl MissingDoc {
|
||||
article: &'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.
|
||||
// It's an option so the crate root can also use this function (it doesn't
|
||||
// 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() {}
|
Loading…
Reference in New Issue
Block a user