]> git.lizzy.rs Git - rust.git/blob - tests/ui/generics/issue-65285-incorrect-explicit-lifetime-name-needed.stderr
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / 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 help: consider introducing a higher-ranked lifetime here with `for<'a>`
8   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:5:32
9    |
10 LL | fn should_error<T>() where T : Into<&u32> {}
11    |                                ^
12
13 error[E0106]: missing lifetime specifier
14   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:20
15    |
16 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
17    |                    ^ expected named lifetime parameter
18    |
19 note: these named lifetimes are available to use
20   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:8:9
21    |
22 LL | trait X<'a, K: 'a> {
23    |         ^^
24 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
25    |            ^^
26 help: consider using one of the available lifetimes here
27    |
28 LL |     fn foo<'b, L: X<'lifetime, &'b Nested<K>>>();
29    |                     ++++++++++
30
31 error[E0106]: missing lifetime specifier
32   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:14:16
33    |
34 LL | fn bar<'b, L: X<&'b Nested<i32>>>(){}
35    |                ^ expected named lifetime parameter
36    |
37 help: consider using the `'b` lifetime
38    |
39 LL | fn bar<'b, L: X<'b, &'b Nested<i32>>>(){}
40    |                 +++
41
42 error[E0477]: the type `&'b Nested<K>` does not fulfill the required lifetime
43   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:19
44    |
45 LL |     fn foo<'b, L: X<&'b Nested<K>>>();
46    |                   ^^^^^^^^^^^^^^^^
47    |
48 note: type must satisfy the static lifetime as required by this binding
49   --> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:8:16
50    |
51 LL | trait X<'a, K: 'a> {
52    |                ^^
53
54 error: aborting due to 4 previous errors
55
56 Some errors have detailed explanations: E0106, E0477, E0637.
57 For more information about an error, try `rustc --explain E0106`.