about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/empty_docs.rs
blob: 57f8976cd6a794a144af14cbb4e41964b54b13ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//@aux-build:proc_macro_attr.rs

#![allow(unused)]
#![warn(clippy::empty_docs)]
#![allow(clippy::mixed_attributes_style)]
#![feature(extern_types)]

mod outer {
    //!
    //~^ empty_docs

    /// this is a struct
    struct Bananas {
        /// count
        count: usize,
    }

    ///
    //~^ empty_docs
    enum Warn {
        ///
        //~^ empty_docs
        A,
        B,
    }

    enum DontWarn {
        /// i
        A,
        B,
    }

    #[doc = ""]
    //~^ empty_docs
    fn warn_about_this() {}

    #[doc = ""]
    #[doc = ""]
    //~^^ empty_docs
    fn this_doesn_warn() {}

    #[doc = "a fine function"]
    fn this_is_fine() {}

    ///
    //~^ empty_docs
    mod inner {
        ///
        fn dont_warn_inner_outer() {
            //!w
        }

        fn this_is_ok() {
            //!
            //! inside the function
        }

        fn warn() {
            /*! */
            //~^ empty_docs
        }

        fn dont_warn() {
            /*! dont warn me */
        }

        trait NoDoc {
            ///
            //~^ empty_docs
            fn some() {}
        }
    }

    union Unite {
        /// lint y
        x: i32,
        ///
        //~^ empty_docs
        y: i32,
    }
}

mod issue_12377 {
    use proc_macro_attr::with_empty_docs;

    #[with_empty_docs]
    unsafe extern "C" {
        type Test;
    }

    #[with_empty_docs]
    struct Foo {
        a: u8,
    }
}