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