]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
New upstream version 1.26.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / empty_line_after_outer_attribute.rs
CommitLineData
2c00a5a8
XL
1
2#![warn(empty_line_after_outer_attr)]
3
4// This should produce a warning
5#[crate_type = "lib"]
6
7/// some comment
8fn with_one_newline_and_comment() { assert!(true) }
9
10// This should not produce a warning
11#[crate_type = "lib"]
12/// some comment
13fn with_no_newline_and_comment() { assert!(true) }
14
15
16// This should produce a warning
17#[crate_type = "lib"]
18
19fn with_one_newline() { assert!(true) }
20
21// This should produce a warning, too
22#[crate_type = "lib"]
23
24
25fn with_two_newlines() { assert!(true) }
26
27
28// This should produce a warning
29#[crate_type = "lib"]
30
31enum Baz {
32 One,
33 Two
34}
35
36// This should produce a warning
37#[crate_type = "lib"]
38
39struct Foo {
40 one: isize,
41 two: isize
42}
43
44// This should produce a warning
45#[crate_type = "lib"]
46
47mod 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)]
59fn three_attributes() { assert!(true) }
60
0531ce1d
XL
61// This should not produce a warning
62#[doc = "
63Returns the escaped value of the textual representation of
64
65"]
66pub fn function() -> bool {
67 true
68}
69
70// This should not produce a warning
71#[derive(Clone, Copy)]
72pub enum FooFighter {
73 Bar1,
74
75 Bar2,
76
77 Bar3,
78
79 Bar4
80}
81
2c00a5a8 82fn main() { }