File tree 2 files changed +54
-5
lines changed
2 files changed +54
-5
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,34 @@ pub mod module3 {
38
38
//~^ ERROR
39
39
pub fn test ( ) { }
40
40
}
41
+
42
+ /// Doc, but no code example and it's fine!
43
+ pub const Const : u32 = 0 ;
44
+ /// Doc, but no code example and it's fine!
45
+ pub static Static : u32 = 0 ;
46
+ /// Doc, but no code example and it's fine!
47
+ pub type Type = u32 ;
48
+
49
+ /// Doc
50
+ //~^ ERROR
51
+ pub struct Struct {
52
+ /// Doc, but no code example and it's fine!
53
+ pub field : u32 ,
54
+ }
55
+
56
+ /// Doc
57
+ //~^ ERROR
58
+ pub enum Enum {
59
+ /// Doc, but no code example and it's fine!
60
+ X ,
61
+ }
62
+
63
+ /// Doc
64
+ //~^ ERROR
65
+ #[ repr( C ) ]
66
+ union Union {
67
+ /// Doc, but no code example and it's fine!
68
+ a : i32 ,
69
+ /// Doc, but no code example and it's fine!
70
+ b : f32 ,
71
+ }
Original file line number Diff line number Diff line change 1
1
error: missing code example in this documentation
2
- --> $DIR/lint-missing-doc-code-example.rs:19 :1
2
+ --> $DIR/lint-missing-doc-code-example.rs:49 :1
3
3
|
4
- LL | / mod module1 {
5
- LL | | }
6
- | |_^
4
+ LL | /// Doc
5
+ | ^^^^^^^
7
6
|
8
7
note: the lint level is defined here
9
8
--> $DIR/lint-missing-doc-code-example.rs:2:9
10
9
|
11
10
LL | #![deny(missing_doc_code_examples)]
12
11
| ^^^^^^^^^^^^^^^^^^^^^^^^^
13
12
13
+ error: missing code example in this documentation
14
+ --> $DIR/lint-missing-doc-code-example.rs:63:1
15
+ |
16
+ LL | /// Doc
17
+ | ^^^^^^^
18
+
19
+ error: missing code example in this documentation
20
+ --> $DIR/lint-missing-doc-code-example.rs:56:1
21
+ |
22
+ LL | /// Doc
23
+ | ^^^^^^^
24
+
25
+ error: missing code example in this documentation
26
+ --> $DIR/lint-missing-doc-code-example.rs:19:1
27
+ |
28
+ LL | / mod module1 {
29
+ LL | | }
30
+ | |_^
31
+
14
32
error: missing code example in this documentation
15
33
--> $DIR/lint-missing-doc-code-example.rs:37:3
16
34
|
17
35
LL | /// doc
18
36
| ^^^^^^^
19
37
20
- error: aborting due to 2 previous errors
38
+ error: aborting due to 5 previous errors
21
39
You can’t perform that action at this time.
0 commit comments