fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.1 KiB27 linesraw
1error[E0106]: missing lifetime specifier
2  --> $DIR/issue-19707.rs:3:28
3   |
4LL | 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
8help: consider introducing a named lifetime parameter
9   |
10LL | type Foo<'lifetime> = fn(&u8, &u8) -> &'lifetime u8;
11   |         ^^^^^^^^^^^                   ^^^^^^^^^^
12
13error[E0106]: missing lifetime specifier
14  --> $DIR/issue-19707.rs:5:27
15   |
16LL | fn bar<F: Fn(&u8, &u8) -> &u8>(f: &F) {}
17   |                           ^ expected named lifetime parameter
18   |
19   = 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
20help: consider introducing a named lifetime parameter
21   |
22LL | fn bar<'lifetime, F: Fn(&u8, &u8) -> &'lifetime u8>(f: &F) {}
23   |        ^^^^^^^^^^                    ^^^^^^^^^^
24
25error: aborting due to 2 previous errors
26
27For more information about this error, try `rustc --explain E0106`.