1 error[E0277]: `T` cannot be shared between threads safely
2 --> $DIR/phantom-auto-trait.rs:21:12
4 LL | fn is_zen<T: Zen>(_: T) {}
5 | --- required by this bound in `is_zen`
8 | ^ `T` cannot be shared between threads safely
10 note: required because of the requirements on the impl of `Zen` for `&T`
11 --> $DIR/phantom-auto-trait.rs:10:24
13 LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
15 = note: required because it appears within the type `PhantomData<&T>`
16 note: required because it appears within the type `Guard<'_, T>`
17 --> $DIR/phantom-auto-trait.rs:12:8
19 LL | struct Guard<'a, T: 'a> {
21 help: consider restricting type parameter `T`
23 LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
26 error[E0277]: `T` cannot be shared between threads safely
27 --> $DIR/phantom-auto-trait.rs:26:12
29 LL | fn is_zen<T: Zen>(_: T) {}
30 | --- required by this bound in `is_zen`
33 | ^ `T` cannot be shared between threads safely
35 note: required because of the requirements on the impl of `Zen` for `&T`
36 --> $DIR/phantom-auto-trait.rs:10:24
38 LL | unsafe impl<'a, T: 'a> Zen for &'a T where T: Sync {}
40 = note: required because it appears within the type `PhantomData<&T>`
41 note: required because it appears within the type `Guard<'_, T>`
42 --> $DIR/phantom-auto-trait.rs:12:8
44 LL | struct Guard<'a, T: 'a> {
46 note: required because it appears within the type `Nested<Guard<'_, T>>`
47 --> $DIR/phantom-auto-trait.rs:16:8
49 LL | struct Nested<T>(T);
51 help: consider restricting type parameter `T`
53 LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
56 error: aborting due to 2 previous errors
58 For more information about this error, try `rustc --explain E0277`.