aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/torture/traits13.rs
blob: 5d9c81943d9c3245a0a9dc8a059fee3c4deb1807 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#[lang = "sized"]
pub trait Sized {}

trait Trait {
    const FOO: usize;
    type Target;
}

struct S;
// { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }

impl Trait for S {
    const FOO: usize = 0;
    type Target = usize;
}

fn main() {
    let a: <S as Trait>::Target;
    a = <S as Trait>::FOO;
}