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
4 LL | / static SOME_STRUCT: &SomeStruct = &SomeStruct {
5 LL | | foo: &Foo { bools: &[false, true] },
6 LL | | bar: &Bar { bools: &[true, true] },
10 | |__^ `dyn for<'a, 'b> Fn(&'a Foo<'b>) -> &'a Foo<'b>` cannot be shared between threads safely
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
17 LL | struct SomeStruct<'x, 'y, 'z: 'x> {
19 = note: required because it appears within the type `&SomeStruct`
20 = note: shared static variables must have a type that implements `Sync`
22 error[E0308]: mismatched types
23 --> $DIR/rfc1623.rs:21:35
25 LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
26 | ___________________________________^
27 LL | | foo: &Foo { bools: &[false, true] },
28 LL | | bar: &Bar { bools: &[true, true] },
32 | |_^ one type is more general than the other
34 = note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
35 found type `Fn<(&Foo<'_>,)>`
37 error[E0308]: mismatched types
38 --> $DIR/rfc1623.rs:21:35
40 LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
41 | ___________________________________^
42 LL | | foo: &Foo { bools: &[false, true] },
43 LL | | bar: &Bar { bools: &[true, true] },
47 | |_^ one type is more general than the other
49 = note: expected type `for<'a, 'b> Fn<(&'a Foo<'b>,)>`
50 found type `Fn<(&Foo<'_>,)>`
52 error: implementation of `FnOnce` is not general enough
53 --> $DIR/rfc1623.rs:21:35
55 LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
56 | ___________________________________^
57 LL | | foo: &Foo { bools: &[false, true] },
58 LL | | bar: &Bar { bools: &[true, true] },
62 | |_^ implementation of `FnOnce` is not general enough
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`
67 error: implementation of `FnOnce` is not general enough
68 --> $DIR/rfc1623.rs:21:35
70 LL | static SOME_STRUCT: &SomeStruct = &SomeStruct {
71 | ___________________________________^
72 LL | | foo: &Foo { bools: &[false, true] },
73 LL | | bar: &Bar { bools: &[true, true] },
77 | |_^ implementation of `FnOnce` is not general enough
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`
82 error: aborting due to 5 previous errors
84 Some errors have detailed explanations: E0277, E0308.
85 For more information about an error, try `rustc --explain E0277`.