error[E0308]: mismatched types --> $DIR/regions-infer-not-param.rs:19:54 | LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } | ^ lifetime mismatch | = note: expected struct `Direct<'b>` found struct `Direct<'a>` note: the lifetime `'a` as defined here... --> $DIR/regions-infer-not-param.rs:19:16 | LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } | ^^ note: ...does not necessarily outlive the lifetime `'b` as defined here --> $DIR/regions-infer-not-param.rs:19:19 | LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p } | ^^ error[E0308]: mismatched types --> $DIR/regions-infer-not-param.rs:25:63 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^ lifetime mismatch | = note: expected struct `Indirect2<'b>` found struct `Indirect2<'a>` note: the lifetime `'a` as defined here... --> $DIR/regions-infer-not-param.rs:25:19 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^^ note: ...does not necessarily outlive the lifetime `'b` as defined here --> $DIR/regions-infer-not-param.rs:25:22 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^^ error[E0308]: mismatched types --> $DIR/regions-infer-not-param.rs:25:63 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^ lifetime mismatch | = note: expected struct `Indirect2<'b>` found struct `Indirect2<'a>` note: the lifetime `'b` as defined here... --> $DIR/regions-infer-not-param.rs:25:22 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^^ note: ...does not necessarily outlive the lifetime `'a` as defined here --> $DIR/regions-infer-not-param.rs:25:19 | LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p } | ^^ error: aborting due to 3 previous errors For more information about this error, try `rustc --explain E0308`.