about summary refs log tree commit diff
path: root/tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs
blob: f603ff1ec80ec08e2576bc60be81a4fd8eebc953 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ check-pass

trait Super {
    type Assoc;
}

trait Sub: Super {}

impl<T: ?Sized> Super for T {
    type Assoc = i32;
}

fn illegal(x: &dyn Sub<Assoc = i32>) -> &dyn Super<Assoc = impl Sized> {
    x
}

fn main() {}