]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/suggest-introducing-and-adding-missing-lifetime.stderr
a8b0996d8b0c71ad404e19ca4b5ff8dc64cd6e69
[rust.git] / src / test / ui / lifetimes / suggest-introducing-and-adding-missing-lifetime.stderr
1 error[E0311]: the parameter type `T` may not live long enough
2   --> $DIR/suggest-introducing-and-adding-missing-lifetime.rs:2:5
3    |
4 LL |     with_restriction::<T>(x)
5    |     ^^^^^^^^^^^^^^^^^^^^^
6    |
7 note: the parameter type `T` must be valid for the anonymous lifetime defined here...
8   --> $DIR/suggest-introducing-and-adding-missing-lifetime.rs:1:25
9    |
10 LL | fn no_restriction<T>(x: &()) -> &() {
11    |                         ^^^
12 note: ...so that the type `T` will meet its required lifetime bounds
13   --> $DIR/suggest-introducing-and-adding-missing-lifetime.rs:2:5
14    |
15 LL |     with_restriction::<T>(x)
16    |     ^^^^^^^^^^^^^^^^^^^^^
17 help: consider adding an explicit lifetime bound...
18    |
19 LL | fn no_restriction<'a, T: 'a>(x: &()) -> &() {
20    |                   +++  ++++
21
22 error: aborting due to previous error
23