about summary refs log tree commit diff
path: root/tests/ui/coherence/super-traits/super-trait-knowable-3.rs
blob: 6198d3d303bd1a26244c06ba245276dc73fc10f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Unlike in `super-trait-knowable-1.rs`, the knowable
// super trait bound is in a nested goal so this would not
// compile if we were to only elaborate root goals.

//@ check-pass

trait Super {}
trait Sub<T>: Super {}

struct W<T>(T);
trait Bound<T> {}
impl<T: Sub<U>, U> Bound<W<U>> for T {}

trait Overlap<T> {}
impl<T, U: Bound<W<T>>> Overlap<T> for U {}
impl<T> Overlap<T> for () {}

fn main() {}