Files
rust/tests/ui/traits/trait-upcasting/illegal-upcast-to-impl-opaque.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
287 B
Rust
Raw Normal View History

2024-05-23 15:46:56 +00:00
//@ 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() {}