rust/tests/ui/unsized/issue-75899.rs
2023-12-14 15:22:37 +01:00

21 lines
362 B
Rust

// revisions: current next
//[next] compile-flags: -Znext-solver
// check-pass
trait Trait {}
impl<T> Trait for T {}
trait Noop {
type Assoc: ?Sized;
}
impl<T: ?Sized> Noop for T {
type Assoc = T;
}
struct NoopNewtype<T: ?Sized + Noop>(T::Assoc);
fn coerce_newtype<T: Trait>(x: &NoopNewtype<T>) -> &NoopNewtype<dyn Trait + '_> {
x
}
fn main() {}