about summary refs log tree commit diff
path: root/tests/ui/lint/dead-code/unconstructible-pub-struct.rs
blob: 2202cbb673098ddd08b2db8545b42c4e931a5356 (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
#![feature(never_type)]
#![deny(dead_code)]

pub struct T1(!);
pub struct T2(());
pub struct T3<X>(std::marker::PhantomData<X>);

pub struct T4 {
    _x: !,
}

pub struct T5<X> {
    _x: !,
    _y: X,
}

pub struct T6 {
    _x: (),
}

pub struct T7<X> {
    _x: (),
    _y: X,
}

pub struct T8<X> {
    _x: std::marker::PhantomData<X>,
}

pub struct T9<X> { //~ ERROR struct `T9` is never constructed
    _x: std::marker::PhantomData<X>,
    _y: i32,
}

fn main() {}