File tree 2 files changed +29
-6
lines changed 2 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 1
1
2
2
#![ warn( empty_line_after_outer_attr) ]
3
3
4
+ // This should produce a warning
5
+ #[ crate_type = "lib" ]
6
+
7
+ /// some comment
8
+ fn with_one_newline_and_comment ( ) { assert ! ( true ) }
9
+
10
+ // This should not produce a warning
11
+ #[ crate_type = "lib" ]
12
+ /// some comment
13
+ fn with_no_newline_and_comment ( ) { assert ! ( true ) }
14
+
15
+
4
16
// This should produce a warning
5
17
#[ crate_type = "lib" ]
6
18
Original file line number Diff line number Diff line change @@ -3,17 +3,28 @@ error: Found an empty line after an outer attribute. Perhaps you forgot to add a
3
3
|
4
4
5 | / #[crate_type = "lib"]
5
5
6 | |
6
- 7 | | fn with_one_newline() { assert!(true) }
6
+ 7 | | /// some comment
7
+ 8 | | fn with_one_newline_and_comment() { assert!(true) }
7
8
| |_
8
9
|
9
10
= note: `-D empty-line-after-outer-attr` implied by `-D warnings`
10
11
11
12
error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
12
- --> $DIR/empty_line_after_outer_attribute.rs:10 :1
13
+ --> $DIR/empty_line_after_outer_attribute.rs:17 :1
13
14
|
14
- 10 | / #[crate_type = "lib"]
15
- 11 | |
16
- 12 | |
17
- 13 | | fn with_two_newlines() { assert!(true) }
15
+ 17 | / #[crate_type = "lib"]
16
+ 18 | |
17
+ 19 | | fn with_one_newline() { assert!(true) }
18
18
| |_
19
19
20
+ error: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
21
+ --> $DIR/empty_line_after_outer_attribute.rs:22:1
22
+ |
23
+ 22 | / #[crate_type = "lib"]
24
+ 23 | |
25
+ 24 | |
26
+ 25 | | fn with_two_newlines() { assert!(true) }
27
+ | |_
28
+
29
+ error: aborting due to 3 previous errors
30
+
You can’t perform that action at this time.
0 commit comments