|
1 | 1 | cfg_if!( |
2 | 2 | if #[cfg(not(parallel_compiler))] { |
| 3 | + #[cfg(bootstrap)] |
3 | 4 | pub auto trait DynSend {} |
| 5 | + |
| 6 | + #[cfg(not(bootstrap))] |
| 7 | + #[rustc_auto_trait] |
| 8 | + pub trait DynSend {} |
| 9 | + |
| 10 | + #[cfg(bootstrap)] |
4 | 11 | pub auto trait DynSync {} |
5 | 12 |
|
| 13 | + #[cfg(not(bootstrap))] |
| 14 | + #[rustc_auto_trait] |
| 15 | + pub trait DynSync {} |
| 16 | + |
6 | 17 | impl<T> DynSend for T {} |
7 | 18 | impl<T> DynSync for T {} |
8 | 19 | } else { |
| 20 | + #[cfg(bootstrap)] |
| 21 | + #[rustc_on_unimplemented( |
| 22 | + message = "`{Self}` doesn't implement `DynSend`. \ |
| 23 | + Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Send`" |
| 24 | + )] |
| 25 | + pub unsafe auto trait DynSend {} |
| 26 | + |
| 27 | + #[cfg(not(bootstrap))] |
9 | 28 | #[rustc_on_unimplemented( |
10 | 29 | message = "`{Self}` doesn't implement `DynSend`. \ |
11 | 30 | Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Send`" |
12 | 31 | )] |
| 32 | + #[rustc_auto_trait] |
13 | 33 | // This is an auto trait for types which can be sent across threads if `sync::is_dyn_thread_safe()` |
14 | 34 | // is true. These types can be wrapped in a `FromDyn` to get a `Send` type. Wrapping a |
15 | 35 | // `Send` type in `IntoDynSyncSend` will create a `DynSend` type. |
16 | | - pub unsafe auto trait DynSend {} |
| 36 | + pub unsafe trait DynSend {} |
| 37 | + |
| 38 | + #[cfg(bootstrap)] |
| 39 | + #[rustc_on_unimplemented( |
| 40 | + message = "`{Self}` doesn't implement `DynSync`. \ |
| 41 | + Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Sync`" |
| 42 | + )] |
| 43 | + pub unsafe auto trait DynSync {} |
17 | 44 |
|
| 45 | + #[cfg(not(bootstrap))] |
18 | 46 | #[rustc_on_unimplemented( |
19 | 47 | message = "`{Self}` doesn't implement `DynSync`. \ |
20 | 48 | Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Sync`" |
21 | 49 | )] |
| 50 | + #[rustc_auto_trait] |
22 | 51 | // This is an auto trait for types which can be shared across threads if `sync::is_dyn_thread_safe()` |
23 | 52 | // is true. These types can be wrapped in a `FromDyn` to get a `Sync` type. Wrapping a |
24 | 53 | // `Sync` type in `IntoDynSyncSend` will create a `DynSync` type. |
25 | | - pub unsafe auto trait DynSync {} |
| 54 | + pub unsafe trait DynSync {} |
26 | 55 |
|
27 | 56 | // Same with `Sync` and `Send`. |
28 | 57 | unsafe impl<T: DynSync + ?Sized> DynSend for &T {} |
|
0 commit comments