Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait X<'a> {
- type T: 'a;
- }
- struct A;
- impl<'a> X<'a> for A {
- type T = &'a i8;
- }
- /*
- impl<'x> Into<&'x i8> for &'x A {
- fn into(self) -> &'x i8 {
- &0
- }
- }*/
- impl<'x> From<&'x A> for &'x i8 {
- fn from(_: &'x A) -> &'x i8 {
- &0
- }
- }
- fn x<Y>(v: Y) where for<'a> Y: X<'a>, for<'a> &'a Y: Into<<Y as X<'a>>::T> {
- (&v).into();
- }
- fn main() {
- // x(A);
- x::<A>(A);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement