Skip to content

Commit 9d7e579

Browse files
Add rustdoc-ui tests for warning emitted when auto_cfg is not used with doc_auto_cfg feature
1 parent ed57b8a commit 9d7e579

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/test/rustdoc-ui/doc_auto_cfg.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// check-pass
2+
#![feature(doc_auto_cfg)]
+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
warning: the `doc_auto_cfg` feature is used but `#![doc(auto_cfg)]` isn't so it won't do anything
2+
3+
warning: 1 warning emitted
4+

src/test/rustdoc-ui/doc_no_auto_cfg.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ error: this attribute can only be applied at the crate level
44
LL | #[doc(auto_cfg)]
55
| ^^^^^^^^
66
|
7+
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8+
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
9+
= note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
710
note: the lint level is defined here
811
--> $DIR/doc_no_auto_cfg.rs:2:9
912
|
1013
LL | #![deny(warnings)]
1114
| ^^^^^^^^
1215
= note: `#[deny(invalid_doc_attributes)]` implied by `#[deny(warnings)]`
13-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
14-
= note: for more information, see issue #82730 <https://github.com/rust-lang/rust/issues/82730>
15-
= note: read <https://doc.rust-lang.org/nightly/rustdoc/the-doc-attribute.html#at-the-crate-level> for more information
1616
help: to apply to the crate, use an inner attribute
1717
|
1818
LL | #![doc(auto_cfg)]

0 commit comments

Comments
 (0)