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