|
1 |
| -cfg_if!( |
2 |
| - if #[cfg(not(parallel_compiler))] { |
| 1 | +cfg_match! { |
| 2 | + cfg(not(parallel_compiler)) => { |
3 | 3 | pub auto trait DynSend {}
|
4 | 4 | pub auto trait DynSync {}
|
5 | 5 |
|
6 | 6 | impl<T> DynSend for T {}
|
7 | 7 | impl<T> DynSync for T {}
|
8 |
| - } else { |
| 8 | + } |
| 9 | + _ => { |
9 | 10 | #[rustc_on_unimplemented(
|
10 | 11 | message = "`{Self}` doesn't implement `DynSend`. \
|
11 | 12 | Add it to `rustc_data_structures::marker` or use `IntoDynSyncSend` if it's already `Send`"
|
@@ -48,13 +49,10 @@ cfg_if!(
|
48 | 49 | [std::io::StdoutLock<'_>]
|
49 | 50 | [std::io::StderrLock<'_>]
|
50 | 51 | );
|
51 |
| - cfg_if!( |
52 |
| - // Consistent with `std` |
53 |
| - // `os_imp::Env` is `!Send` in these platforms |
54 |
| - if #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] { |
55 |
| - impl !DynSend for std::env::VarsOs {} |
56 |
| - } |
57 |
| - ); |
| 52 | + |
| 53 | + #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] |
| 54 | + // Consistent with `std`, `os_imp::Env` is `!Sync` in these platforms |
| 55 | + impl !DynSend for std::env::VarsOs {} |
58 | 56 |
|
59 | 57 | macro_rules! already_send {
|
60 | 58 | ($([$ty: ty])*) => {
|
@@ -123,13 +121,10 @@ cfg_if!(
|
123 | 121 | [std::sync::mpsc::Receiver<T> where T]
|
124 | 122 | [std::sync::mpsc::Sender<T> where T]
|
125 | 123 | );
|
126 |
| - cfg_if!( |
127 |
| - // Consistent with `std` |
128 |
| - // `os_imp::Env` is `!Sync` in these platforms |
129 |
| - if #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] { |
130 |
| - impl !DynSync for std::env::VarsOs {} |
131 |
| - } |
132 |
| - ); |
| 124 | + |
| 125 | + #[cfg(any(unix, target_os = "hermit", target_os = "wasi", target_os = "solid_asp3"))] |
| 126 | + // Consistent with `std`, `os_imp::Env` is `!Sync` in these platforms |
| 127 | + impl !DynSync for std::env::VarsOs {} |
133 | 128 |
|
134 | 129 | macro_rules! already_sync {
|
135 | 130 | ($([$ty: ty])*) => {
|
@@ -183,7 +178,7 @@ cfg_if!(
|
183 | 178 | [thin_vec::ThinVec<T> where T: DynSync]
|
184 | 179 | );
|
185 | 180 | }
|
186 |
| -); |
| 181 | +} |
187 | 182 |
|
188 | 183 | pub fn assert_dyn_sync<T: ?Sized + DynSync>() {}
|
189 | 184 | pub fn assert_dyn_send<T: ?Sized + DynSend>() {}
|
|
0 commit comments