Debian Codegraph @

gcc/testsuite/rust/compile/torture/traits13.rs

raw
1 #[lang = "sized"]
2 pub trait Sized {}
3
4 trait Trait {
5 const FOO: usize;
6 type Target;
7 }
8
9 struct S;
10 // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
11
12 impl Trait for S {
13 const FOO: usize = 0;
14 type Target = usize;
15 }
16
17 fn main() {
18 let a: <S as Trait>::Target;
19 a = <S as Trait>::FOO;
20 }