error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements --> $DIR/type-alias-free-regions.rs:17:9 | LL | C { f: b } | ^ | note: first, the lifetime cannot outlive the anonymous lifetime defined on the method body at 16:24... --> $DIR/type-alias-free-regions.rs:16:24 | LL | fn from_box(b: Box) -> Self { | ^ note: ...so that the expression is assignable --> $DIR/type-alias-free-regions.rs:17:16 | LL | C { f: b } | ^ = note: expected `Box>` found `Box>` note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 15:6... --> $DIR/type-alias-free-regions.rs:15:6 | LL | impl<'a> FromBox<'a> for C<'a> { | ^^ note: ...so that the expression is assignable --> $DIR/type-alias-free-regions.rs:17:9 | LL | C { f: b } | ^^^^^^^^^^ = note: expected `C<'a>` found `C<'_>` error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements --> $DIR/type-alias-free-regions.rs:27:16 | LL | C { f: Box::new(b.0) } | ^^^^^^^^^^^^^ | note: first, the lifetime cannot outlive the anonymous lifetime defined on the method body at 26:23... --> $DIR/type-alias-free-regions.rs:26:23 | LL | fn from_tuple(b: (B,)) -> Self { | ^ note: ...so that the expression is assignable --> $DIR/type-alias-free-regions.rs:27:25 | LL | C { f: Box::new(b.0) } | ^^^ = note: expected `Box<&isize>` found `Box<&isize>` note: but, the lifetime must be valid for the lifetime `'a` as defined on the impl at 25:6... --> $DIR/type-alias-free-regions.rs:25:6 | LL | impl<'a> FromTuple<'a> for C<'a> { | ^^ note: ...so that the expression is assignable --> $DIR/type-alias-free-regions.rs:27:9 | LL | C { f: Box::new(b.0) } | ^^^^^^^^^^^^^^^^^^^^^^ = note: expected `C<'a>` found `C<'_>` error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0495`.