| 1 |
#[lang = "sized"] |
| 2 |
pub trait Sized {} |
| 3 |
|
| 4 |
struct S; // { dg-warning "struct is never constructed" } |
| 5 |
impl S { |
| 6 |
fn f() -> i32 { return 0; } |
| 7 |
// { dg-warning "associated function is never used" "" { target *-*-* } .-1 } |
| 8 |
} |
| 9 |
|
| 10 |
trait T1 { |
| 11 |
type A; |
| 12 |
fn f() -> i32 { return 0; } |
| 13 |
} |
| 14 |
|
| 15 |
impl T1 for S { |
| 16 |
type A = S; |
| 17 |
} |
| 18 |
|
| 19 |
trait T2 { |
| 20 |
type B; |
| 21 |
fn f() -> i32 { return 0; } |
| 22 |
} |
| 23 |
|
| 24 |
impl T2 for S { |
| 25 |
type B = S; |
| 26 |
} |
| 27 |
|
| 28 |
trait T3 { |
| 29 |
fn f() -> i32 { return 0; } |
| 30 |
} |
| 31 |
|
| 32 |
impl T3 for S {} |
| 33 |
|
| 34 |
fn main() { |
| 35 |
let _ = <<S as T1>::A as T2>::f(); |
| 36 |
let _ = <<<S as T1>::A as T2>::B as T3>::f(); |
| 37 |
} |