]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/bound-lifetime-in-binding-only.elision.stderr
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / bound-lifetime-in-binding-only.elision.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/bound-lifetime-in-binding-only.rs:52:23
3    |
4 LL | fn elision<T: Fn() -> &i32>() {
5    |                       ^ expected named lifetime parameter
6    |
7    = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from
8    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
9 help: consider making the bound lifetime-generic with a new `'a` lifetime
10    |
11 LL | fn elision<T: for<'a> Fn() -> &'a i32>() {
12    |               ^^^^^^^         ^^^
13 help: consider using the `'static` lifetime
14    |
15 LL | fn elision<T: Fn() -> &'static i32>() {
16    |                       ^^^^^^^^
17
18 error: aborting due to previous error
19
20 For more information about this error, try `rustc --explain E0106`.