aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/compile/bug-with-default-generic.rs
blob: 25f46a09c7dcdaa24a100f9f741d2c700c3957aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#[lang = "sized"]
pub trait Sized {}

pub trait MyBinaryTrait<Rhs = Self> {
    fn do_something(&self, rhs: &Rhs);
}

struct Foo<T> {
    // { dg-warning "struct is never constructed" "" { target *-*-* } .-1 }
    value: T,
}

impl<T> MyBinaryTrait for Foo<T> {
    fn do_something(&self, _rhs: &Self) {}
}