rust/tests/ui/unsized/issue-75899.rs

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

22 lines
422 B
Rust
Raw Normal View History

//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
2023-12-14 06:11:28 -06:00
//@[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() {}