2018-08-08 12:28:26 +00:00
|
|
|
error[E0277]: `T` cannot be shared between threads safely
|
2020-11-24 23:44:04 +00:00
|
|
|
--> $DIR/phantom-auto-trait.rs:21:12
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | is_zen(x)
|
2021-09-07 11:30:53 +00:00
|
|
|
| ------ ^ `T` cannot be shared between threads safely
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2022-08-15 20:31:37 +00:00
|
|
|
note: required for `&T` to implement `Zen`
|
2021-03-30 20:37:30 +00:00
|
|
|
--> $DIR/phantom-auto-trait.rs:10:24
|
|
|
|
|
|
|
|
|
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
|
2023-01-11 03:21:11 +00:00
|
|
|
| ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: required because it appears within the type `PhantomData<&T>`
|
2021-03-30 20:37:30 +00:00
|
|
|
note: required because it appears within the type `Guard<'_, T>`
|
|
|
|
--> $DIR/phantom-auto-trait.rs:12:8
|
|
|
|
|
|
|
|
|
LL | struct Guard<'a, T: 'a> {
|
|
|
|
| ^^^^^
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `is_zen`
|
|
|
|
--> $DIR/phantom-auto-trait.rs:18:14
|
|
|
|
|
|
|
|
|
LL | fn is_zen<T: Zen>(_: T) {}
|
|
|
|
| ^^^ required by this bound in `is_zen`
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `T`
|
|
|
|
|
|
2021-03-30 09:56:39 +00:00
|
|
|
LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++++++++++++++++++
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error[E0277]: `T` cannot be shared between threads safely
|
2020-11-24 23:44:04 +00:00
|
|
|
--> $DIR/phantom-auto-trait.rs:26:12
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | is_zen(x)
|
2021-09-07 11:30:53 +00:00
|
|
|
| ------ ^ `T` cannot be shared between threads safely
|
|
|
|
| |
|
|
|
|
| required by a bound introduced by this call
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
2022-08-15 20:31:37 +00:00
|
|
|
note: required for `&T` to implement `Zen`
|
2021-03-30 20:37:30 +00:00
|
|
|
--> $DIR/phantom-auto-trait.rs:10:24
|
|
|
|
|
|
|
|
|
LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
|
2023-01-11 03:21:11 +00:00
|
|
|
| ^^^ ^^^^^ ---- unsatisfied trait bound introduced here
|
2020-09-02 07:40:56 +00:00
|
|
|
= note: required because it appears within the type `PhantomData<&T>`
|
2021-03-30 20:37:30 +00:00
|
|
|
note: required because it appears within the type `Guard<'_, T>`
|
|
|
|
--> $DIR/phantom-auto-trait.rs:12:8
|
|
|
|
|
|
|
|
|
LL | struct Guard<'a, T: 'a> {
|
|
|
|
| ^^^^^
|
|
|
|
note: required because it appears within the type `Nested<Guard<'_, T>>`
|
|
|
|
--> $DIR/phantom-auto-trait.rs:16:8
|
|
|
|
|
|
|
|
|
LL | struct Nested<T>(T);
|
|
|
|
| ^^^^^^
|
2021-07-31 16:26:55 +00:00
|
|
|
note: required by a bound in `is_zen`
|
|
|
|
--> $DIR/phantom-auto-trait.rs:18:14
|
|
|
|
|
|
|
|
|
LL | fn is_zen<T: Zen>(_: T) {}
|
|
|
|
| ^^^ required by this bound in `is_zen`
|
2020-03-14 02:28:14 +00:00
|
|
|
help: consider restricting type parameter `T`
|
|
|
|
|
|
2021-03-30 09:56:39 +00:00
|
|
|
LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
|
2021-06-22 02:07:19 +00:00
|
|
|
| +++++++++++++++++++
|
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`.
|