1error[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 | 4LL | / static SOME_STRUCT: &SomeStruct = &SomeStruct { 5LL | | foo: &Foo { bools: &[false, true] }, 6LL | | bar: &Bar { bools: &[true, true] }, 7LL | | f: &id, 8LL | | 9LL | | }; 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>` 14note: required because it appears within the type `SomeStruct` 15 --> $DIR/rfc1623.rs:11:8 16 | 17LL | 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 22error[E0308]: mismatched types 23 --> $DIR/rfc1623.rs:21:35 24 | 25LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { 26 | ___________________________________^ 27LL | | foo: &Foo { bools: &[false, true] }, 28LL | | bar: &Bar { bools: &[true, true] }, 29LL | | f: &id, 30LL | | 31LL | | }; 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 37error[E0308]: mismatched types 38 --> $DIR/rfc1623.rs:21:35 39 | 40LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { 41 | ___________________________________^ 42LL | | foo: &Foo { bools: &[false, true] }, 43LL | | bar: &Bar { bools: &[true, true] }, 44LL | | f: &id, 45LL | | 46LL | | }; 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 52error: implementation of `FnOnce` is not general enough 53 --> $DIR/rfc1623.rs:21:35 54 | 55LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { 56 | ___________________________________^ 57LL | | foo: &Foo { bools: &[false, true] }, 58LL | | bar: &Bar { bools: &[true, true] }, 59LL | | f: &id, 60LL | | 61LL | | }; 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 67error: implementation of `FnOnce` is not general enough 68 --> $DIR/rfc1623.rs:21:35 69 | 70LL | static SOME_STRUCT: &SomeStruct = &SomeStruct { 71 | ___________________________________^ 72LL | | foo: &Foo { bools: &[false, true] }, 73LL | | bar: &Bar { bools: &[true, true] }, 74LL | | f: &id, 75LL | | 76LL | | }; 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 82error: aborting due to 5 previous errors 83 84Some errors have detailed explanations: E0277, E0308. 85For more information about an error, try `rustc --explain E0277`. 86