mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
19 lines
297 B
Rust
19 lines
297 B
Rust
// 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() {}
|