1 A lifetime cannot be determined in the given situation.
3 Erroneous code example:
6 fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
7 match (&t,) { // error!
12 let y = Box::new((42,));
13 let x = transmute_lifetime(&y);
16 In this code, you have two ways to solve this issue:
17 1. Enforce that `'a` lives at least as long as `'b`.
18 2. Use the same lifetime requirement for both input and output values.
20 So for the first solution, you can do it by replacing `'a` with `'a: 'b`:
23 fn transmute_lifetime<'a: 'b, 'b, T>(t: &'a (T,)) -> &'b T {
30 In the second you can do it by simply removing `'b` so they both use `'a`:
33 fn transmute_lifetime<'a, T>(t: &'a (T,)) -> &'a T {