]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1623.nll.stderr
Rollup merge of #88090 - nbdd0121:inference, r=nikomatsakis
[rust.git] / src / test / ui / rfc1623.nll.stderr
1 error[E0277]: `dyn for<'a, 'b> Fn(&'a Foo<'b>) -> &'a Foo<'b>` cannot be shared between threads safely
2   --> $DIR/rfc1623.rs:21:1
3    |
4 LL | / static SOME_STRUCT: &SomeStruct = &SomeStruct {
5 LL | |     foo: &Foo { bools: &[false, true] },
6 LL | |     bar: &Bar { bools: &[true, true] },
7 LL | |     f: &id,
8 LL | |
9 LL | | };
10    | |__^ `dyn for<'a, 'b> Fn(&'a Foo<'b>) -> &'a Foo<'b>` cannot be shared between threads safely
11    |
12    = help: within `&SomeStruct`, the trait `Sync` is not implemented for `dyn for<'a, 'b> Fn(&'a Foo<'b>) -> &'a Foo<'b>`
13    = note: required because it appears within the type `&dyn for<'a, 'b> Fn(&'a Foo<'b>) -> &'a Foo<'b>`
14 note: required because it appears within the type `SomeStruct`
15   --> $DIR/rfc1623.rs:11:8
16    |
17 LL | struct SomeStruct<'x, 'y, 'z: 'x> {
18    |        ^^^^^^^^^^
19    = note: required because it appears within the type `&SomeStruct`
20    = note: shared static variables must have a type that implements `Sync`
21
22 error[E0308]: mismatched types
23   --> $DIR/rfc1623.rs:21:35
24    |
25 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
26    |  ___________________________________^
27 LL | |     foo: &Foo { bools: &[false, true] },
28 LL | |     bar: &Bar { bools: &[true, true] },
29 LL | |     f: &id,
30 LL | |
31 LL | | };
32    | |_^ one type is more general than the other
33    |
34    = note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
35               found type `Fn<(&Foo<'_>,)>`
36
37 error[E0308]: mismatched types
38   --> $DIR/rfc1623.rs:21:35
39    |
40 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
41    |  ___________________________________^
42 LL | |     foo: &Foo { bools: &[false, true] },
43 LL | |     bar: &Bar { bools: &[true, true] },
44 LL | |     f: &id,
45 LL | |
46 LL | | };
47    | |_^ one type is more general than the other
48    |
49    = note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
50               found type `Fn<(&Foo<'_>,)>`
51
52 error: implementation of `FnOnce` is not general enough
53   --> $DIR/rfc1623.rs:21:35
54    |
55 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
56    |  ___________________________________^
57 LL | |     foo: &Foo { bools: &[false, true] },
58 LL | |     bar: &Bar { bools: &[true, true] },
59 LL | |     f: &id,
60 LL | |
61 LL | | };
62    | |_^ implementation of `FnOnce` is not general enough
63    |
64    = note: `fn(&'2 Foo<'_>) -> &'2 Foo<'_> {id::<&'2 Foo<'_>>}` must implement `FnOnce<(&'1 Foo<'b>,)>`, for any lifetime `'1`...
65    = note: ...but it actually implements `FnOnce<(&'2 Foo<'_>,)>`, for some specific lifetime `'2`
66
67 error: implementation of `FnOnce` is not general enough
68   --> $DIR/rfc1623.rs:21:35
69    |
70 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
71    |  ___________________________________^
72 LL | |     foo: &Foo { bools: &[false, true] },
73 LL | |     bar: &Bar { bools: &[true, true] },
74 LL | |     f: &id,
75 LL | |
76 LL | | };
77    | |_^ implementation of `FnOnce` is not general enough
78    |
79    = note: `fn(&Foo<'2>) -> &Foo<'2> {id::<&Foo<'2>>}` must implement `FnOnce<(&'a Foo<'1>,)>`, for any lifetime `'1`...
80    = note: ...but it actually implements `FnOnce<(&Foo<'2>,)>`, for some specific lifetime `'2`
81
82 error: aborting due to 5 previous errors
83
84 Some errors have detailed explanations: E0277, E0308.
85 For more information about an error, try `rustc --explain E0277`.