about summary refs log tree commit diff
path: root/tests/ui/lint/dead-code/issue-41883.rs
blob: e165861e893e052365f6400d7e5abae625aea3e6 (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
#![deny(dead_code)]

enum Category {
    Dead, //~ ERROR variant `Dead` is never constructed
    Used,
}

trait UnusedTrait { //~ ERROR trait `UnusedTrait` is never used
    fn this_is_unused(&self) -> Category {
        Category::Dead
    }
}

struct UnusedStruct; //~ ERROR struct `UnusedStruct` is never constructed

impl UnusedTrait for UnusedStruct {
    fn this_is_unused(&self) -> Category {
        Category::Used
    }
}

mod private {
    #[derive(Debug)]
    struct UnusedStruct; //~ ERROR struct `UnusedStruct` is never constructed
}

fn main() {
    let _c = Category::Used;
}