]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc1623.nll.stderr
Auto merge of #84589 - In-line:zircon-thread-name, r=JohnTitor
[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: higher-ranked subtype error
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    | |_^
33
34 error: higher-ranked subtype error
35   --> $DIR/rfc1623.rs:21:35
36    |
37 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
38    |  ___________________________________^
39 LL | |     foo: &Foo { bools: &[false, true] },
40 LL | |     bar: &Bar { bools: &[true, true] },
41 LL | |     f: &id,
42 LL | |
43 LL | | };
44    | |_^
45
46 error: higher-ranked subtype error
47   --> $DIR/rfc1623.rs:21:35
48    |
49 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
50    |  ___________________________________^
51 LL | |     foo: &Foo { bools: &[false, true] },
52 LL | |     bar: &Bar { bools: &[true, true] },
53 LL | |     f: &id,
54 LL | |
55 LL | | };
56    | |_^
57
58 error: higher-ranked subtype error
59   --> $DIR/rfc1623.rs:21:35
60    |
61 LL |   static SOME_STRUCT: &SomeStruct = &SomeStruct {
62    |  ___________________________________^
63 LL | |     foo: &Foo { bools: &[false, true] },
64 LL | |     bar: &Bar { bools: &[true, true] },
65 LL | |     f: &id,
66 LL | |
67 LL | | };
68    | |_^
69
70 error: aborting due to 5 previous errors
71
72 For more information about this error, try `rustc --explain E0277`.