]> git.lizzy.rs Git - rust.git/blob - tests/ui/empty_line_after_outer_attribute.rs
Auto merge of #4478 - tsurai:master, r=flip1995
[rust.git] / tests / ui / empty_line_after_outer_attribute.rs
1 #![warn(clippy::empty_line_after_outer_attr)]
2 #![allow(clippy::assertions_on_constants)]
3 #![feature(custom_inner_attributes)]
4 #![rustfmt::skip]
5
6 // This should produce a warning
7 #[crate_type = "lib"]
8
9 /// some comment
10 fn with_one_newline_and_comment() { assert!(true) }
11
12 // This should not produce a warning
13 #[crate_type = "lib"]
14 /// some comment
15 fn with_no_newline_and_comment() { assert!(true) }
16
17
18 // This should produce a warning
19 #[crate_type = "lib"]
20
21 fn with_one_newline() { assert!(true) }
22
23 // This should produce a warning, too
24 #[crate_type = "lib"]
25
26
27 fn with_two_newlines() { assert!(true) }
28
29
30 // This should produce a warning
31 #[crate_type = "lib"]
32
33 enum Baz {
34     One,
35     Two
36 }
37
38 // This should produce a warning
39 #[crate_type = "lib"]
40
41 struct Foo {
42     one: isize,
43     two: isize
44 }
45
46 // This should produce a warning
47 #[crate_type = "lib"]
48
49 mod foo {
50 }
51
52 /// This doc comment should not produce a warning
53
54 /** This is also a doc comment and should not produce a warning
55  */
56
57 // This should not produce a warning
58 #[allow(non_camel_case_types)]
59 #[allow(missing_docs)]
60 #[allow(missing_docs)]
61 fn three_attributes() { assert!(true) }
62
63 // This should not produce a warning
64 #[doc = "
65 Returns the escaped value of the textual representation of
66
67 "]
68 pub fn function() -> bool {
69     true
70 }
71
72 // This should not produce a warning
73 #[derive(Clone, Copy)]
74 pub enum FooFighter {
75     Bar1,
76
77     Bar2,
78
79     Bar3,
80
81     Bar4
82 }
83
84 // This should not produce a warning because the empty line is inside a block comment
85 #[crate_type = "lib"]
86 /*
87
88 */
89 pub struct S;
90
91 // This should not produce a warning
92 #[crate_type = "lib"]
93 /* test */
94 pub struct T;
95
96 fn main() { }