summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui-toml/upper_case_acronyms_aggressive/upper_case_acronyms.rs
blob: 1a5cf1b1947c5e7be4c8266da92d6a63ab9552fa (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
#![warn(clippy::upper_case_acronyms)]

struct HTTPResponse; // not linted by default, but with cfg option

struct CString; // not linted

enum Flags {
    NS, // not linted
    CWR,
    ECE,
    URG,
    ACK,
    PSH,
    RST,
    SYN,
    FIN,
}

// linted with cfg option, beware that lint suggests `GccllvmSomething` instead of
// `GccLlvmSomething`
struct GCCLLVMSomething;

// don't warn on public items
pub struct MIXEDCapital;

pub struct FULLCAPITAL;

// enum variants should not be linted if the num is pub
pub enum ParseError<T> {
    FULLCAPITAL(u8),
    MIXEDCapital(String),
    Utf8(std::string::FromUtf8Error),
    Parse(T, String),
}

// private, do lint here
enum ParseErrorPrivate<T> {
    WASD(u8),
    WASDMixed(String),
    Utf8(std::string::FromUtf8Error),
    Parse(T, String),
}

fn main() {}