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