]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1623.nll.stderr
Rollup merge of #95699 - SparkyPotato:master, r=dtolnay
[rust.git] / src / test / ui / rfc1623.nll.stderr
1 error[E0308]: mismatched types
2   --> $DIR/rfc1623.rs:29:35
3    |
4 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
5    |  ___________________________________^
6 LL | |
7 LL | |
8 LL | |
9 ...  |
10 LL | |
11 LL | | };
12    | |_^ one type is more general than the other
13    |
14    = note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
15               found type `Fn<(&Foo<'_>,)>`
16
17 error[E0308]: mismatched types
18   --> $DIR/rfc1623.rs:29:35
19    |
20 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
21    |  ___________________________________^
22 LL | |
23 LL | |
24 LL | |
25 ...  |
26 LL | |
27 LL | | };
28    | |_^ one type is more general than the other
29    |
30    = note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
31               found type `Fn<(&Foo<'_>,)>`
32
33 error: implementation of `FnOnce` is not general enough
34   --> $DIR/rfc1623.rs:29:35
35    |
36 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
37    |  ___________________________________^
38 LL | |
39 LL | |
40 LL | |
41 ...  |
42 LL | |
43 LL | | };
44    | |_^ implementation of `FnOnce` is not general enough
45    |
46    = note: `fn(&'2 Foo<'_>) -> &'2 Foo<'_> {id::<&'2 Foo<'_>>}` must implement `FnOnce<(&'1 Foo<'b>,)>`, for any lifetime `'1`...
47    = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2`
48
49 error: implementation of `FnOnce` is not general enough
50   --> $DIR/rfc1623.rs:29:35
51    |
52 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
53    |  ___________________________________^
54 LL | |
55 LL | |
56 LL | |
57 ...  |
58 LL | |
59 LL | | };
60    | |_^ implementation of `FnOnce` is not general enough
61    |
62    = note: `fn(&Foo<'2>) -> &Foo<'2> {id::<&Foo<'2>>}` must implement `FnOnce<(&'a Foo<'1>,)>`, for any lifetime `'1`...
63    = note: ...but it actually implements `FnOnce<(&Foo<'2>,)>`, for some specific lifetime `'2`
64
65 error: aborting due to 4 previous errors
66
67 For more information about this error, try `rustc --explain E0308`.