Skip to content

Commit d13baed

Browse files
committed
Auto merge of #111835 - matthiaskrgr:rollup-qd4b2vu, r=matthiaskrgr
Rollup of 2 pull requests Successful merges: - #111810 (Don't use inner macro in `marker_impls`) - #111826 (Render test messages from bootstrap) r? `@ghost` `@rustbot` modify labels: rollup
2 parents e2d6788 + bb49d8f commit d13baed

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

core/src/marker.rs

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,27 +43,17 @@ use crate::hash::Hasher;
4343
/// ```
4444
#[unstable(feature = "internal_impls_macro", issue = "none")]
4545
macro marker_impls {
46-
( $(#[$($meta:tt)*])* $Trait:ident for $( $({$($bounds:tt)*})? $T:ty ),+ $(,)?) => {
47-
// This inner macro is needed because... idk macros are weird.
48-
// It allows repeating `meta` on all impls.
49-
#[unstable(feature = "internal_impls_macro", issue = "none")]
50-
macro _impl {
51-
( $$({$$($$bounds_:tt)*})? $$T_:ty ) => {
52-
$(#[$($meta)*])* impl<$$($$($$bounds_)*)?> $Trait for $$T_ {}
53-
}
54-
}
55-
$( _impl! { $({$($bounds)*})? $T } )+
46+
( $(#[$($meta:tt)*])* $Trait:ident for $({$($bounds:tt)*})? $T:ty $(, $($rest:tt)*)? ) => {
47+
$(#[$($meta)*])* impl< $($($bounds)*)? > $Trait for $T {}
48+
marker_impls! { $(#[$($meta)*])* $Trait for $($($rest)*)? }
5649
},
57-
( $(#[$($meta:tt)*])* unsafe $Trait:ident for $( $({$($bounds:tt)*})? $T:ty ),+ $(,)?) => {
58-
#[unstable(feature = "internal_impls_macro", issue = "none")]
59-
macro _impl {
60-
( $$({$$($$bounds_:tt)*})? $$T_:ty ) => {
61-
$(#[$($meta)*])* unsafe impl<$$($$($$bounds_)*)?> $Trait for $$T_ {}
62-
}
63-
}
50+
( $(#[$($meta:tt)*])* $Trait:ident for ) => {},
6451

65-
$( _impl! { $({$($bounds)*})? $T } )+
52+
( $(#[$($meta:tt)*])* unsafe $Trait:ident for $({$($bounds:tt)*})? $T:ty $(, $($rest:tt)*)? ) => {
53+
$(#[$($meta)*])* unsafe impl< $($($bounds)*)? > $Trait for $T {}
54+
marker_impls! { $(#[$($meta)*])* unsafe $Trait for $($($rest)*)? }
6655
},
56+
( $(#[$($meta:tt)*])* unsafe $Trait:ident for ) => {},
6757
}
6858

6959
/// Types that can be transferred across thread boundaries.

0 commit comments

Comments
 (0)