mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 09:44:08 +00:00
18 lines
575 B
Rust
18 lines
575 B
Rust
|
#![feature(unsize, dispatch_from_dyn)]
|
||
|
|
||
|
use std::marker::Unsize;
|
||
|
use std::ops::DispatchFromDyn;
|
||
|
|
||
|
#[allow(unused)]
|
||
|
struct Foo<'a, T: ?Sized> {
|
||
|
_inner: &'a &'a T,
|
||
|
}
|
||
|
|
||
|
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Foo<'a, U>> for Foo<'a, T> {}
|
||
|
//~^ ERROR the trait bound `&'a T: std::marker::Unsize<&'a U>` is not satisfied
|
||
|
//~| NOTE the trait `std::marker::Unsize<&'a U>` is not implemented for `&'a T`
|
||
|
//~| NOTE all implementations of `Unsize` are provided automatically by the compiler
|
||
|
//~| NOTE required because of the requirements on the impl
|
||
|
|
||
|
fn main() {}
|