fork/rust

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

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

1.42.0
1.7 KiB39 linesraw
1error[E0106]: missing lifetime specifier
2  --> $DIR/issue-30255.rs:9:24
3   |
4LL | fn f(a: &S, b: i32) -> &i32 {
5   |                        ^ expected named lifetime parameter
6   |
7   = help: this function's return type contains a borrowed value, but the signature does not say which one of `a`'s 2 lifetimes it is borrowed from
8help: consider introducing a named lifetime parameter
9   |
10LL | fn f<'lifetime>(a: &S, b: i32) -> &'lifetime i32 {
11   |     ^^^^^^^^^^^                   ^^^^^^^^^^
12
13error[E0106]: missing lifetime specifier
14  --> $DIR/issue-30255.rs:14:34
15   |
16LL | fn g(a: &S, b: bool, c: &i32) -> &i32 {
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 one of `a`'s 2 lifetimes or `c`
20help: consider introducing a named lifetime parameter
21   |
22LL | fn g<'lifetime>(a: &S, b: bool, c: &i32) -> &'lifetime i32 {
23   |     ^^^^^^^^^^^                             ^^^^^^^^^^
24
25error[E0106]: missing lifetime specifier
26  --> $DIR/issue-30255.rs:19:44
27   |
28LL | fn h(a: &bool, b: bool, c: &S, d: &i32) -> &i32 {
29   |                                            ^ expected named lifetime parameter
30   |
31   = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `a`, one of `c`'s 2 lifetimes, or `d`
32help: consider introducing a named lifetime parameter
33   |
34LL | fn h<'lifetime>(a: &bool, b: bool, c: &S, d: &i32) -> &'lifetime i32 {
35   |     ^^^^^^^^^^^                                       ^^^^^^^^^^
36
37error: aborting due to 3 previous errors
38
39For more information about this error, try `rustc --explain E0106`.