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