From 85b1116a18595794da07c53642eefd81ff775faf Mon Sep 17 00:00:00 2001 From: clubby789 Date: Mon, 10 Mar 2025 15:58:41 +0000 Subject: [PATCH] rustdoc: Add FIXME test for `doc_cfg` interaction with `check_cfg` --- tests/rustdoc-ui/doc-cfg-check-cfg.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 tests/rustdoc-ui/doc-cfg-check-cfg.rs diff --git a/tests/rustdoc-ui/doc-cfg-check-cfg.rs b/tests/rustdoc-ui/doc-cfg-check-cfg.rs new file mode 100644 index 000000000000..e3420dc07897 --- /dev/null +++ b/tests/rustdoc-ui/doc-cfg-check-cfg.rs @@ -0,0 +1,16 @@ +// Ensure that `doc(cfg())` respects `check-cfg` +// Currently not properly working +#![feature(doc_cfg)] +#![deny(unexpected_cfgs)] + +//@revisions: no_check cfg_empty cfg_foo +//@[cfg_empty] compile-flags: --check-cfg cfg() +//@[cfg_foo] compile-flags: --check-cfg cfg(foo) + +//@[no_check] check-pass +//@[cfg_empty] check-pass +//@[cfg_empty] known-bug: #138358 +//@[cfg_foo] check-pass + +#[doc(cfg(foo))] +pub fn foo() {}