fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

1.40.0
2.3 KiB39 linesraw
1error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
2  --> $DIR/send-sync.rs:8:5
3   |
4LL | fn send<T: Send>(_: T) {}
5   |    ----    ---- required by this bound in `send`
6...
7LL |     send(format_args!("{:?}", c));
8   |     ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
9   |
10   = help: within `[std::fmt::ArgumentV1<'_>]`, the trait `std::marker::Sync` is not implemented for `*mut (dyn std::ops::Fn() + 'static)`
11   = note: required because it appears within the type `std::marker::PhantomData<*mut (dyn std::ops::Fn() + 'static)>`
12   = note: required because it appears within the type `core::fmt::Void`
13   = note: required because it appears within the type `&core::fmt::Void`
14   = note: required because it appears within the type `std::fmt::ArgumentV1<'_>`
15   = note: required because it appears within the type `[std::fmt::ArgumentV1<'_>]`
16   = note: required because of the requirements on the impl of `std::marker::Send` for `&[std::fmt::ArgumentV1<'_>]`
17   = note: required because it appears within the type `std::fmt::Arguments<'_>`
18
19error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
20  --> $DIR/send-sync.rs:9:5
21   |
22LL | fn sync<T: Sync>(_: T) {}
23   |    ----    ---- required by this bound in `sync`
24...
25LL |     sync(format_args!("{:?}", c));
26   |     ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely
27   |
28   = help: within `std::fmt::Arguments<'_>`, the trait `std::marker::Sync` is not implemented for `*mut (dyn std::ops::Fn() + 'static)`
29   = note: required because it appears within the type `std::marker::PhantomData<*mut (dyn std::ops::Fn() + 'static)>`
30   = note: required because it appears within the type `core::fmt::Void`
31   = note: required because it appears within the type `&core::fmt::Void`
32   = note: required because it appears within the type `std::fmt::ArgumentV1<'_>`
33   = note: required because it appears within the type `[std::fmt::ArgumentV1<'_>]`
34   = note: required because it appears within the type `&[std::fmt::ArgumentV1<'_>]`
35   = note: required because it appears within the type `std::fmt::Arguments<'_>`
36
37error: aborting due to 2 previous errors
38
39For more information about this error, try `rustc --explain E0277`.