rust/tests/rustdoc-ui/check-fail.rs
Noah Lev fbd548acc3 Only include stable lints in rustdoc::all group
Including unstable lints in the lint group produces unintuitive behavior
on stable (see #106289). Meanwhile, if we only included unstable lints
on nightly and not on stable, we could end up with confusing bugs that
were hard to compare across versions of Rust that lacked code changes.

I think that only including stable lints in `rustdoc::all`, no matter
the release channel, is the most intuitive option. Users can then
control unstable lints individually, which is reasonable since they have
to enable the feature gates individually anyway.
2023-02-19 22:05:58 -08:00

24 lines
375 B
Rust

// compile-flags: -Z unstable-options --check
#![feature(rustdoc_missing_doc_code_examples)]
#![deny(missing_docs)]
#![deny(rustdoc::missing_doc_code_examples)]
#![deny(rustdoc::all)]
//! ```rust,testharness
//~^ ERROR
//! let x = 12;
//! ```
pub fn foo() {}
//~^ ERROR
//~^^ ERROR
/// hello
//~^ ERROR
///
/// ```rust,testharness
/// let x = 12;
/// ```
pub fn bar() {}