@@ -88,19 +88,10 @@ LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
8888 | ^ expected named lifetime parameter
8989 |
9090 = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
91- help: consider using the `'a` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
91+ help: consider using the `'a` lifetime
9292 |
9393LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
9494 | ++
95- help: instead, you are more likely to want to change the argument to be borrowed...
96- |
97- LL | fn k<'a, T: WithLifetime<'a>>(_x: &T::Output) -> &isize {
98- | +
99- help: ...or alternatively, you might want to return an owned value
100- |
101- LL - fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
102- LL + fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> isize {
103- |
10495
10596error[E0106]: missing lifetime specifier
10697 --> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:45:37
@@ -109,18 +100,10 @@ LL | fn l<'a>(_: &'a str, _: &'a str) -> &str { "" }
109100 | ------- ------- ^ expected named lifetime parameter
110101 |
111102 = help: this function's return type contains a borrowed value with an elided lifetime, but the lifetime cannot be derived from the arguments
112- help: consider using the `'a` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static`
103+ help: consider using the `'a` lifetime
113104 |
114105LL | fn l<'a>(_: &'a str, _: &'a str) -> &'a str { "" }
115106 | ++
116- help: instead, you are more likely to want to change one of the arguments to be borrowed...
117- |
118- LL | fn l<'a>(_: &&'a str, _: &&'a str) -> &str { "" }
119- | + +
120- help: ...or alternatively, you might want to return an owned value
121- |
122- LL | fn l<'a>(_: &'a str, _: &'a str) -> String { "" }
123- | ~~~~~~
124107
125108error: aborting due to 7 previous errors
126109
0 commit comments