fork/rust

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

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.6 KiB40 linesraw
1error[E0277]: `T` cannot be shared between threads safely
2  --> $DIR/phantom-oibit.rs:21:12
3   |
4LL | fn is_zen<T: Zen>(_: T) {}
5   |              --- required by this bound in `is_zen`
6...
7LL |     is_zen(x)
8   |            ^ `T` cannot be shared between threads safely
9   |
10   = help: the trait `std::marker::Sync` is not implemented for `T`
11   = note: required because of the requirements on the impl of `Zen` for `&T`
12   = note: required because it appears within the type `std::marker::PhantomData<&T>`
13   = note: required because it appears within the type `Guard<'_, T>`
14help: consider restricting type parameter `T`
15   |
16LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
17   |              ^^^^^^^^^^^^^^^^^^^
18
19error[E0277]: `T` cannot be shared between threads safely
20  --> $DIR/phantom-oibit.rs:26:12
21   |
22LL | fn is_zen<T: Zen>(_: T) {}
23   |              --- required by this bound in `is_zen`
24...
25LL |     is_zen(x)
26   |            ^ `T` cannot be shared between threads safely
27   |
28   = help: the trait `std::marker::Sync` is not implemented for `T`
29   = note: required because of the requirements on the impl of `Zen` for `&T`
30   = note: required because it appears within the type `std::marker::PhantomData<&T>`
31   = note: required because it appears within the type `Guard<'_, T>`
32   = note: required because it appears within the type `Nested<Guard<'_, T>>`
33help: consider restricting type parameter `T`
34   |
35LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
36   |                     ^^^^^^^^^^^^^^^^^^^
37
38error: aborting due to 2 previous errors
39
40For more information about this error, try `rustc --explain E0277`.