fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.4 KiB36 linesraw
1error[E0106]: missing lifetime specifier
2  --> $DIR/issue-86667.rs:6:35
3   |
4LL | async fn a(s1: &str, s2: &str) -> &str {
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 `s1` or `s2`
8help: consider introducing a named lifetime parameter
9   |
10LL | async fn a<'a>(s1: &'a str, s2: &'a str) -> &'a str {
11   |           ++++      ++           ++          ++
12
13error[E0106]: missing lifetime specifier
14  --> $DIR/issue-86667.rs:12:29
15   |
16LL | fn b(s1: &str, s2: &str) -> &str {
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 `s1` or `s2`
20help: consider introducing a named lifetime parameter
21   |
22LL | fn b<'a>(s1: &'a str, s2: &'a str) -> &'a str {
23   |     ++++      ++           ++          ++
24
25error: lifetime may not live long enough
26  --> $DIR/issue-86667.rs:8:5
27   |
28LL | async fn a(s1: &str, s2: &str) -> &str {
29   |                - let's call the lifetime of this reference `'1`
30LL |
31LL |     s1
32   |     ^^ returning this value requires that `'1` must outlive `'static`
33
34error: aborting due to 3 previous errors
35
36For more information about this error, try `rustc --explain E0106`.