1 error: lifetime may not live long enough
2 --> $DIR/outlives-suggestion-simple.rs:4:5
4 LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
5 | -- -- lifetime `'b` defined here
7 | lifetime `'a` defined here
9 | ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
11 = help: consider adding the following bound: `'a: 'b`
13 error: lifetime may not live long enough
14 --> $DIR/outlives-suggestion-simple.rs:8:5
16 LL | fn foo2<'a>(x: &'a usize) -> &'static usize {
17 | -- lifetime `'a` defined here
19 | ^ returning this value requires that `'a` must outlive `'static`
21 error: lifetime may not live long enough
22 --> $DIR/outlives-suggestion-simple.rs:12:5
24 LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
25 | -- -- lifetime `'b` defined here
27 | lifetime `'a` defined here
29 | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
31 = help: consider adding the following bound: `'a: 'b`
33 error: lifetime may not live long enough
34 --> $DIR/outlives-suggestion-simple.rs:12:5
36 LL | fn foo3<'a, 'b>(x: &'a usize, y: &'b usize) -> (&'b usize, &'a usize) {
37 | -- -- lifetime `'b` defined here
39 | lifetime `'a` defined here
41 | ^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
43 = help: consider adding the following bound: `'b: 'a`
45 help: `'a` and `'b` must be the same: replace one with the other
47 error: lifetime may not live long enough
48 --> $DIR/outlives-suggestion-simple.rs:20:5
50 LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) {
51 | -- -- lifetime `'b` defined here
53 | lifetime `'a` defined here
56 | ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
58 = help: consider adding the following bound: `'a: 'b`
60 error: lifetime may not live long enough
61 --> $DIR/outlives-suggestion-simple.rs:29:9
63 LL | pub fn foo<'a>(x: &'a usize) -> Self {
64 | -- lifetime `'a` defined here
66 | ^^^^^^^^^ returning this value requires that `'a` must outlive `'static`
68 error: lifetime may not live long enough
69 --> $DIR/outlives-suggestion-simple.rs:39:9
71 LL | impl<'a> Bar<'a> {
72 | -- lifetime `'a` defined here
73 LL | pub fn get<'b>(&self) -> &'b usize {
74 | -- lifetime `'b` defined here
76 | ^^^^^^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
78 = help: consider adding the following bound: `'a: 'b`
80 error: lifetime may not live long enough
81 --> $DIR/outlives-suggestion-simple.rs:50:9
83 LL | impl<'a> Baz<'a> {
84 | -- lifetime `'a` defined here
85 LL | fn get<'b>(&'b self) -> &'a i32 {
86 | -- lifetime `'b` defined here
88 | ^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
90 = help: consider adding the following bound: `'b: 'a`
92 error: lifetime may not live long enough
93 --> $DIR/outlives-suggestion-simple.rs:71:9
95 LL | impl<'a> Foo2<'a> {
96 | -- lifetime `'a` defined here
97 LL | // should not produce outlives suggestions to name 'self
98 LL | fn get_bar(&self) -> Bar2 {
99 | - let's call the lifetime of this reference `'1`
100 LL | Bar2::new(&self)
101 | ^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'a`
103 error: aborting due to 9 previous errors