mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
27 lines
500 B
Rust
27 lines
500 B
Rust
//! Test that we allow unsizing `Trait<Concrete>` to `Trait<Opaque>` and vice versa
|
|
|
|
//@ check-pass
|
|
|
|
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() {}
|