rust/tests/rustdoc-ui/invalid-cfg.rs
2025-12-10 12:27:34 +01:00

21 lines
732 B
Rust

#![feature(doc_cfg)]
#[doc(cfg = "x")] //~ ERROR malformed `doc` attribute input
#[doc(cfg(x, y))] //~ ERROR malformed `doc` attribute input
pub struct S {}
// We check it also fails on private items.
#[doc(cfg = "x")] //~ ERROR malformed `doc` attribute input
#[doc(cfg(x, y))] //~ ERROR malformed `doc` attribute input
struct X {}
// We check it also fails on hidden items.
#[doc(cfg = "x")] //~ ERROR malformed `doc` attribute input
#[doc(cfg(x, y))] //~ ERROR malformed `doc` attribute input
#[doc(hidden)]
pub struct Y {}
// We check it also fails on hidden AND private items.
#[doc(cfg = "x")] //~ ERROR malformed `doc` attribute input
#[doc(cfg(x, y))] //~ ERROR malformed `doc` attribute input
#[doc(hidden)]
struct Z {}