]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / generics / issue-65285-incorrect-explicit-lifetime-name-needed.stderr
1 error[E0637]: `&` without an explicit lifetime name cannot be used here
2   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:5:37
3    |
4 LL | fn should_error<T>() where T : Into<&u32> {}
5    |                                     ^ explicit lifetime name needed here
6
7 error[E0106]: missing lifetime specifier
8   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:20
9    |
10 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
11    |                    ^ expected named lifetime parameter
12    |
13 note: these named lifetimes are available to use
14   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:8:9
15    |
16 LL | trait X<'a, K: 'a> {
17    |         ^^
18 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
19    |            ^^
20 help: consider using one of the available lifetimes here
21    |
22 LL |     fn foo<'b, L: X<'lifetime, &'b Nested<K>>>();
23    |                     ++++++++++
24
25 error[E0106]: missing lifetime specifier
26   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:14:16
27    |
28 LL | fn bar<'b, L: X<&'b Nested<i32>>>(){}
29    |                ^ expected named lifetime parameter
30    |
31 help: consider using the `'b` lifetime
32    |
33 LL | fn bar<'b, L: X<'b, &'b Nested<i32>>>(){}
34    |                 +++
35
36 error[E0477]: the type `&'b Nested<K>` does not fulfill the required lifetime
37   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:19
38    |
39 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
40    |                   ^^^^^^^^^^^^^^^^
41    |
42 note: type must satisfy the static lifetime as required by this binding
43   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:8:16
44    |
45 LL | trait X<'a, K: 'a> {
46    |                ^^
47
48 error: aborting due to 4 previous errors
49
50 Some errors have detailed explanations: E0106, E0477, E0637.
51 For more information about an error, try `rustc --explain E0106`.