@@ -88,19 +88,10 @@ LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &isize {
88
88
| ^ expected named lifetime parameter
89
89
|
90
90
= 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
92
92
|
93
93
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
94
94
| ++
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
- |
104
95
105
96
error[E0106]: missing lifetime specifier
106
97
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:45:37
@@ -109,18 +100,10 @@ LL | fn l<'a>(_: &'a str, _: &'a str) -> &str { "" }
109
100
| ------- ------- ^ expected named lifetime parameter
110
101
|
111
102
= 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
113
104
|
114
105
LL | fn l<'a>(_: &'a str, _: &'a str) -> &'a str { "" }
115
106
| ++
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
- | ~~~~~~
124
107
125
108
error: aborting due to 7 previous errors
126
109
0 commit comments