rust/src/test/ui/phantom-auto-trait.stderr

39 lines
1.4 KiB
Plaintext
Raw Normal View History

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