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