]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0637.stderr
Rollup merge of #97915 - tbu-:pr_os_string_fmt_write, r=joshtriplett
[rust.git] / src / test / ui / error-codes / E0637.stderr
1 error[E0637]: `'_` cannot be used here
2   --> $DIR/E0637.rs:1:24
3    |
4 LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ str) -> &'_ str {
5    |                        ^^ `'_` is a reserved lifetime name
6
7 error[E0637]: `&` without an explicit lifetime name cannot be used here
8   --> $DIR/E0637.rs:13:13
9    |
10 LL |     T: Into<&u32>,
11    |             ^ explicit lifetime name needed here
12
13 error[E0106]: missing lifetime specifier
14   --> $DIR/E0637.rs:1:62
15    |
16 LL | fn underscore_lifetime<'_>(str1: &'_ str, str2: &'_ 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 `str1` or `str2`
20 help: consider introducing a named lifetime parameter
21    |
22 LL | fn underscore_lifetime<'a, '_>(str1: &'a str, str2: &'a str) -> &'a str {
23    |                        +++            ~~             ~~          ~~
24
25 error: aborting due to 3 previous errors
26
27 Some errors have detailed explanations: E0106, E0637.
28 For more information about an error, try `rustc --explain E0106`.