summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/suspicious_doc_comments.rs
blob: cdd972ee30fbf1ec9170be1d7e8876fb927805f6 (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
//@run-rustfix
#![allow(unused)]
#![warn(clippy::suspicious_doc_comments)]

//! Real module documentation.
///! Fake module documentation.
fn baz() {}

pub mod singleline_outer_doc {
    ///! This module contains useful functions.

    pub fn bar() {}
}

pub mod singleline_inner_doc {
    //! This module contains useful functions.

    pub fn bar() {}
}

pub mod multiline_outer_doc {
    /**! This module contains useful functions.
     */

    pub fn bar() {}
}

pub mod multiline_inner_doc {
    /*! This module contains useful functions.
     */

    pub fn bar() {}
}

pub mod multiline_outer_doc2 {
    ///! This module
    ///! contains
    ///! useful functions.

    pub fn bar() {}
}

pub mod multiline_outer_doc3 {
    ///! a
    ///! b

    /// c
    pub fn bar() {}
}

pub mod multiline_outer_doc4 {
    ///! a
    /// b
    pub fn bar() {}
}

pub mod multiline_outer_doc_gap {
    ///! a

    ///! b
    pub fn bar() {}
}

pub mod multiline_outer_doc_commented {
    /////! This outer doc comment was commented out.
    pub fn bar() {}
}

pub mod outer_doc_macro {
    ///! Very cool macro
    macro_rules! x {
        () => {};
    }
}

pub mod useless_outer_doc {
    ///! Huh.
    use std::mem;
}

fn main() {}