fork/rust

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

borsAuto merge of #71868 - Mark-Simulacrum:stable-1.43.1, r=pietroalbini8d69840ab92

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