]> git.lizzy.rs Git - rust.git/blob - tests/ui/issues/issue-19707.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / ui / issues / issue-19707.stderr
1 error[E0106]: missing lifetime specifier
2   --> $DIR/issue-19707.rs:3:28
3    |
4 LL | type Foo = fn(&u8, &u8) -> &u8;
5    |               ---  ---     ^ expected named lifetime parameter
6    |
7    = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
8    = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html
9 help: consider making the type lifetime-generic with a new `'a` lifetime
10    |
11 LL | type Foo = for<'a> fn(&'a u8, &'a u8) -> &'a u8;
12    |            +++++++     ++      ++         ++
13 help: consider introducing a named lifetime parameter
14    |
15 LL | type Foo<'a> = fn(&'a u8, &'a u8) -> &'a u8;
16    |         ++++       ++      ++         ++
17
18 error[E0106]: missing lifetime specifier
19   --> $DIR/issue-19707.rs:5:27
20    |
21 LL | fn bar<F: Fn(&u8, &u8) -> &u8>(f: &F) {}
22    |              ---  ---     ^ expected named lifetime parameter
23    |
24    = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
25 help: consider making the bound lifetime-generic with a new `'a` lifetime
26    |
27 LL | fn bar<F: for<'a> Fn(&'a u8, &'a u8) -> &'a u8>(f: &F) {}
28    |           +++++++     ++      ++         ++
29 help: consider introducing a named lifetime parameter
30    |
31 LL | fn bar<'a, F: Fn(&'a u8, &'a u8) -> &'a u8>(f: &F) {}
32    |        +++        ++      ++         ++
33
34 error: aborting due to 2 previous errors
35
36 For more information about this error, try `rustc --explain E0106`.