summaryrefslogtreecommitdiffstats
path: root/tests/ui/chalkify/recursive_where_clause_on_type.rs
blob: c2c8aa6aabec2990a6901e37db124fd05adf349f (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
// FIXME(chalk): should fail, see comments
// check-fail
// compile-flags: -Z trait-solver=chalk

#![feature(trivial_bounds)]

trait Bar {
    fn foo();
}
trait Foo: Bar { }

struct S where S: Foo;

impl Foo for S {
}

fn bar<T: Bar>() {
    T::foo();
}

fn foo<T: Foo>() {
    bar::<T>()
}

fn main() {
    // For some reason, the error is duplicated...

    foo::<S>() //~ ERROR the type `S` is not well-formed
    //~^ ERROR the type `S` is not well-formed
}