Skip to content

Commit 5d87272

Browse files
committed
Fix test and errors
1 parent 63c2d06 commit 5d87272

File tree

3 files changed

+193
-272
lines changed

3 files changed

+193
-272
lines changed

src/librustc/macros.rs

+10-6
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ macro_rules! __impl_stable_hash_field {
7171

7272
#[macro_export]
7373
macro_rules! impl_stable_hash_for {
74-
(enum $enum_name:path { $( $variant:ident $( ( $($field:ident $(-> $delegate:tt)?),* ) )* ),* $(,)? }) => {
74+
// FIXME(mark-i-m): Some of these should be `?` rather than `*`. See the git blame and change
75+
// them back when `?` is supported again.
76+
(enum $enum_name:path { $( $variant:ident $( ( $($field:ident $(-> $delegate:tt)*),* ) )* ),* $(,)* }) => {
7577
impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $enum_name {
7678
#[inline]
7779
fn hash_stable<W: ::rustc_data_structures::stable_hasher::StableHasherResult>(&self,
@@ -83,14 +85,15 @@ macro_rules! impl_stable_hash_for {
8385
match *self {
8486
$(
8587
$variant $( ( $(ref $field),* ) )* => {
86-
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*)*
88+
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*)*
8789
}
8890
)*
8991
}
9092
}
9193
}
9294
};
93-
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
95+
// FIXME(mark-i-m): same here.
96+
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
9497
impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name {
9598
#[inline]
9699
fn hash_stable<W: ::rustc_data_structures::stable_hasher::StableHasherResult>(&self,
@@ -100,11 +103,12 @@ macro_rules! impl_stable_hash_for {
100103
$(ref $field),*
101104
} = *self;
102105

103-
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
106+
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
104107
}
105108
}
106109
};
107-
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
110+
// FIXME(mark-i-m): same here.
111+
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
108112
impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name {
109113
#[inline]
110114
fn hash_stable<W: ::rustc_data_structures::stable_hasher::StableHasherResult>(&self,
@@ -114,7 +118,7 @@ macro_rules! impl_stable_hash_for {
114118
$(ref $field),*
115119
) = *self;
116120

117-
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
121+
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
118122
}
119123
}
120124
};

0 commit comments

Comments
 (0)