2024-05-24 09:17:54 -05:00
|
|
|
//! Test that we allow unsizing `Trait<Concrete>` to `Trait<Opaque>` and vice versa
|
|
|
|
|
2024-05-27 05:44:35 -05:00
|
|
|
//@ check-pass
|
|
|
|
|
2024-05-24 09:17:54 -05:00
|
|
|
trait Trait<T> {}
|
|
|
|
|
|
|
|
impl<T, U> Trait<T> for U {}
|
|
|
|
|
|
|
|
fn hello() -> &'static (dyn Trait<impl Sized> + Send) {
|
|
|
|
if false {
|
|
|
|
let x = hello();
|
|
|
|
let _: &'static dyn Trait<()> = x;
|
|
|
|
}
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn bye() -> &'static dyn Trait<impl Sized> {
|
|
|
|
if false {
|
|
|
|
let mut x = bye();
|
|
|
|
let y: &'static (dyn Trait<()> + Send) = &();
|
|
|
|
x = y;
|
|
|
|
}
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|