Skip to content

Commit 0c7e244

Browse files
Add test for missing_docs lint on tuple fields
1 parent 89c0d4f commit 0c7e244

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// compile-flags: -Z unstable-options --check
2+
3+
#![deny(missing_docs)]
4+
5+
//! crate level doc
6+
7+
/// Enum doc.
8+
pub enum Foo {
9+
/// Variant doc.
10+
Foo(String),
11+
/// Variant Doc.
12+
Bar(String, u32),
13+
//~^ ERROR
14+
//~^^ ERROR
15+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error: missing documentation for a struct field
2+
--> $DIR/missing-doc-tuple-variant.rs:12:9
3+
|
4+
LL | Bar(String, u32),
5+
| ^^^^^^
6+
|
7+
note: the lint level is defined here
8+
--> $DIR/missing-doc-tuple-variant.rs:3:9
9+
|
10+
LL | #![deny(missing_docs)]
11+
| ^^^^^^^^^^^^
12+
13+
error: missing documentation for a struct field
14+
--> $DIR/missing-doc-tuple-variant.rs:12:17
15+
|
16+
LL | Bar(String, u32),
17+
| ^^^
18+
19+
error: aborting due to 2 previous errors
20+

0 commit comments

Comments
 (0)