|
| 1 | +error: lifetime may not live long enough |
| 2 | + --> $DIR/issue-98589-closures-relate-named-regions.rs:10:5 |
| 3 | + | |
| 4 | +LL | fn test_early_early<'a: 'a, 'b: 'b>() { |
| 5 | + | -- -- lifetime `'b` defined here |
| 6 | + | | |
| 7 | + | lifetime `'a` defined here |
| 8 | +LL | || { None::<&'a &'b ()>; }; |
| 9 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` |
| 10 | + | |
| 11 | + = help: consider adding the following bound: `'b: 'a` |
| 12 | + |
| 13 | +error: lifetime may not live long enough |
| 14 | + --> $DIR/issue-98589-closures-relate-named-regions.rs:15:10 |
| 15 | + | |
| 16 | +LL | fn test_early_late<'a: 'a, 'b>() { |
| 17 | + | -- -- lifetime `'b` defined here |
| 18 | + | | |
| 19 | + | lifetime `'a` defined here |
| 20 | +LL | || { None::<&'a &'b ()>; }; |
| 21 | + | ^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` |
| 22 | + | |
| 23 | + = help: consider adding the following bound: `'b: 'a` |
| 24 | + |
| 25 | +error: lifetime may not live long enough |
| 26 | + --> $DIR/issue-98589-closures-relate-named-regions.rs:21:10 |
| 27 | + | |
| 28 | +LL | fn test_late_late<'a, 'b>() { |
| 29 | + | -- -- lifetime `'b` defined here |
| 30 | + | | |
| 31 | + | lifetime `'a` defined here |
| 32 | +LL | || { None::<&'a &'b ()>; }; |
| 33 | + | ^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'a` |
| 34 | + | |
| 35 | + = help: consider adding the following bound: `'b: 'a` |
| 36 | + |
| 37 | +error[E0309]: the parameter type `T` may not live long enough |
| 38 | + --> $DIR/issue-98589-closures-relate-named-regions.rs:26:5 |
| 39 | + | |
| 40 | +LL | || { None::<&'a T>; }; |
| 41 | + | ^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds |
| 42 | + | |
| 43 | +help: consider adding an explicit lifetime bound... |
| 44 | + | |
| 45 | +LL | fn test_early_type<'a: 'a, T: 'a>() { |
| 46 | + | ++++ |
| 47 | + |
| 48 | +error[E0309]: the parameter type `T` may not live long enough |
| 49 | + --> $DIR/issue-98589-closures-relate-named-regions.rs:32:5 |
| 50 | + | |
| 51 | +LL | || { None::<&'a T>; }; |
| 52 | + | ^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds |
| 53 | + | |
| 54 | +help: consider adding an explicit lifetime bound... |
| 55 | + | |
| 56 | +LL | fn test_late_type<'a, T: 'a>() { |
| 57 | + | ++++ |
| 58 | + |
| 59 | +error: aborting due to 5 previous errors |
| 60 | + |
| 61 | +For more information about this error, try `rustc --explain E0309`. |
0 commit comments