Skip to content

Commit d2c53b7

Browse files
committed
rustdoc: Add test for doc_cfg interaction with check_cfg
1 parent 28bd22c commit d2c53b7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/rustdoc-ui/doc-cfg-check-cfg.rs

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Ensure that `doc(cfg())` respects `check-cfg`
2+
#![feature(doc_cfg)]
3+
4+
//@revisions: no_check cfg_empty cfg_foo
5+
//@[cfg_empty] compile-flags: --check-cfg cfg()
6+
//@[cfg_foo] compile-flags: --check-cfg cfg(foo)
7+
8+
//@[no_check] check-pass
9+
//@[cfg_foo] check-pass
10+
11+
#[doc(cfg(foo))]
12+
pub fn foo() {}

0 commit comments

Comments
 (0)