diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-08-26 16:03:12 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2025-09-27 11:29:50 +0200 |
| commit | 77885fef2cd9a7f9daa4f95336f0cfdeb62b3016 (patch) | |
| tree | 65d6fa476ea49bafef412323035fb7b0e8f11906 /tests/rustdoc-ui | |
| parent | ef8b2a26caccba46584e4753c3091218d4a2e17d (diff) | |
| download | rust-77885fef2cd9a7f9daa4f95336f0cfdeb62b3016.tar.gz rust-77885fef2cd9a7f9daa4f95336f0cfdeb62b3016.zip | |
Improve code comments and extend tests for `doc_cfg` feature
Diffstat (limited to 'tests/rustdoc-ui')
| -rw-r--r-- | tests/rustdoc-ui/doc-cfg.rs | 2 | ||||
| -rw-r--r-- | tests/rustdoc-ui/doc-cfg.stderr | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/tests/rustdoc-ui/doc-cfg.rs b/tests/rustdoc-ui/doc-cfg.rs index 9840c305290..d72643e2355 100644 --- a/tests/rustdoc-ui/doc-cfg.rs +++ b/tests/rustdoc-ui/doc-cfg.rs @@ -13,6 +13,8 @@ #[doc(auto_cfg(hide(42)))] //~ ERROR #[doc(auto_cfg(hide("a")))] //~ ERROR #[doc(auto_cfg(hide(foo::bar)))] //~ ERROR +#[doc(auto_cfg = 42)] //~ ERROR +#[doc(auto_cfg = "a")] //~ ERROR // Shouldn't lint #[doc(auto_cfg(hide(windows)))] #[doc(auto_cfg(hide(feature = "windows")))] diff --git a/tests/rustdoc-ui/doc-cfg.stderr b/tests/rustdoc-ui/doc-cfg.stderr index 36ca18eed8f..13f62e50d90 100644 --- a/tests/rustdoc-ui/doc-cfg.stderr +++ b/tests/rustdoc-ui/doc-cfg.stderr @@ -30,6 +30,18 @@ error: `#![doc(auto_cfg(hide(...)))]` only accepts identifiers or key/value item LL | #[doc(auto_cfg(hide(foo::bar)))] | ^^^^^^^^ +error: `expected boolean for #[doc(auto_cfg = ...)]` + --> $DIR/doc-cfg.rs:16:7 + | +LL | #[doc(auto_cfg = 42)] + | ^^^^^^^^^^^^^ + +error: `expected boolean for #[doc(auto_cfg = ...)]` + --> $DIR/doc-cfg.rs:17:7 + | +LL | #[doc(auto_cfg = "a")] + | ^^^^^^^^^^^^^^ + warning: unexpected `cfg` condition name: `foo` --> $DIR/doc-cfg.rs:6:11 | @@ -74,5 +86,5 @@ error: multiple `cfg` predicates are specified LL | #[doc(cfg(foo, bar))] | ^^^ -error: aborting due to 9 previous errors; 2 warnings emitted +error: aborting due to 11 previous errors; 2 warnings emitted |
