rust/src/test/ui/phantom-oibit.stderr

39 lines
1.5 KiB
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-oibit.rs:21:12
2018-08-08 12:28:26 +00:00
|
LL | fn is_zen<T: Zen>(_: T) {}
2020-04-06 05:15:06 +00:00
| --- required by this bound in `is_zen`
...
2018-08-08 12:28:26 +00:00
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
2018-08-08 12:28:26 +00:00
|
= note: required because of the requirements on the impl of `Zen` for `&T`
= note: required because it appears within the type `std::marker::PhantomData<&T>`
= note: required because it appears within the type `Guard<'_, T>`
help: consider restricting type parameter `T`
|
LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
| ^^^^^^^^^^^^^^^^^^^
2018-08-08 12:28:26 +00:00
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-oibit.rs:26:12
2018-08-08 12:28:26 +00:00
|
LL | fn is_zen<T: Zen>(_: T) {}
2020-04-06 05:15:06 +00:00
| --- required by this bound in `is_zen`
...
2018-08-08 12:28:26 +00:00
LL | is_zen(x)
| ^ `T` cannot be shared between threads safely
2018-08-08 12:28:26 +00:00
|
= note: required because of the requirements on the impl of `Zen` for `&T`
= note: required because it appears within the type `std::marker::PhantomData<&T>`
= note: required because it appears within the type `Guard<'_, T>`
= note: required because it appears within the type `Nested<Guard<'_, T>>`
help: consider restricting type parameter `T`
|
LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
| ^^^^^^^^^^^^^^^^^^^
2018-08-08 12:28:26 +00:00
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.