aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/rust/execute/torture/impl_desugar.rs
blob: 22d39519f305e72042b7674aca49a56a0cff7c26 (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
#[lang = "sized"]
trait Sized {}

pub trait Foo {}

pub trait Bar {
    type Baz;
}

struct MyBaz; // { dg-warning "struct is never constructed" }
impl Foo for MyBaz {}

struct MyBar;

impl Bar for MyBar {
    type Baz = MyBaz;
}

pub fn foo<T, U>(_value: T) -> i32
where
    T: Bar<Baz = U>,
    U: Foo,
{
    15
}

fn main() -> i32 {
    let bar = MyBar;
    let result: i32 = foo::<MyBar, MyBaz>(bar);

    result - 15
}