mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
21 lines
368 B
Rust
21 lines
368 B
Rust
// revisions: current next
|
|
//[next] compile-flags: -Ztrait-solver=next
|
|
// 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() {}
|