1error[E0277]: `T` cannot be shared between threads safely 2 --> $DIR/phantom-auto-trait.rs:21:12 3 | 4LL | is_zen(x) 5 | ------ ^ `T` cannot be shared between threads safely 6 | | 7 | required by a bound introduced by this call 8 | 9note: required because of the requirements on the impl of `Zen` for `&T` 10 --> $DIR/phantom-auto-trait.rs:10:24 11 | 12LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} 13 | ^^^ ^^^^^ 14 = note: required because it appears within the type `PhantomData<&T>` 15note: required because it appears within the type `Guard<'_, T>` 16 --> $DIR/phantom-auto-trait.rs:12:8 17 | 18LL | struct Guard<'a, T: 'a> { 19 | ^^^^^ 20note: required by a bound in `is_zen` 21 --> $DIR/phantom-auto-trait.rs:18:14 22 | 23LL | fn is_zen<T: Zen>(_: T) {} 24 | ^^^ required by this bound in `is_zen` 25help: consider restricting type parameter `T` 26 | 27LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) { 28 | +++++++++++++++++++ 29 30error[E0277]: `T` cannot be shared between threads safely 31 --> $DIR/phantom-auto-trait.rs:26:12 32 | 33LL | is_zen(x) 34 | ------ ^ `T` cannot be shared between threads safely 35 | | 36 | required by a bound introduced by this call 37 | 38note: required because of the requirements on the impl of `Zen` for `&T` 39 --> $DIR/phantom-auto-trait.rs:10:24 40 | 41LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {} 42 | ^^^ ^^^^^ 43 = note: required because it appears within the type `PhantomData<&T>` 44note: required because it appears within the type `Guard<'_, T>` 45 --> $DIR/phantom-auto-trait.rs:12:8 46 | 47LL | struct Guard<'a, T: 'a> { 48 | ^^^^^ 49note: required because it appears within the type `Nested<Guard<'_, T>>` 50 --> $DIR/phantom-auto-trait.rs:16:8 51 | 52LL | struct Nested<T>(T); 53 | ^^^^^^ 54note: required by a bound in `is_zen` 55 --> $DIR/phantom-auto-trait.rs:18:14 56 | 57LL | fn is_zen<T: Zen>(_: T) {} 58 | ^^^ required by this bound in `is_zen` 59help: consider restricting type parameter `T` 60 | 61LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) { 62 | +++++++++++++++++++ 63 64error: aborting due to 2 previous errors 65 66For more information about this error, try `rustc --explain E0277`. 67