Skip to content

Commit

Permalink
Fix test and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-i-m committed Jul 24, 2018
1 parent 63c2d06 commit 5d87272
Show file tree
Hide file tree
Showing 3 changed files with 193 additions and 272 deletions.
16 changes: 10 additions & 6 deletions src/librustc/macros.rs
Expand Up @@ -71,7 +71,9 @@ macro_rules! __impl_stable_hash_field {

#[macro_export]
macro_rules! impl_stable_hash_for {
(enum $enum_name:path { $( $variant:ident $( ( $($field:ident $(-> $delegate:tt)?),* ) )* ),* $(,)? }) => {
// FIXME(mark-i-m): Some of these should be `?` rather than `*`. See the git blame and change
// them back when `?` is supported again.
(enum $enum_name:path { $( $variant:ident $( ( $($field:ident $(-> $delegate:tt)*),* ) )* ),* $(,)* }) => {
impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $enum_name {
#[inline]
fn hash_stable<W: ::rustc_data_structures::stable_hasher::StableHasherResult>(&self,
Expand All @@ -83,14 +85,15 @@ macro_rules! impl_stable_hash_for {
match *self {
$(
$variant $( ( $(ref $field),* ) )* => {
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*)*
$($( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*)*
}
)*
}
}
}
};
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
// FIXME(mark-i-m): same here.
(struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name {
#[inline]
fn hash_stable<W: ::rustc_data_structures::stable_hasher::StableHasherResult>(&self,
Expand All @@ -100,11 +103,12 @@ macro_rules! impl_stable_hash_for {
$(ref $field),*
} = *self;

$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
}
}
};
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)?),* $(,)? }) => {
// FIXME(mark-i-m): same here.
(tuple_struct $struct_name:path { $($field:ident $(-> $delegate:tt)*),* $(,)* }) => {
impl<'a, 'tcx> ::rustc_data_structures::stable_hasher::HashStable<$crate::ich::StableHashingContext<'a>> for $struct_name {
#[inline]
fn hash_stable<W: ::rustc_data_structures::stable_hasher::StableHasherResult>(&self,
Expand All @@ -114,7 +118,7 @@ macro_rules! impl_stable_hash_for {
$(ref $field),*
) = *self;

$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)?) );*
$( __impl_stable_hash_field!($field, __ctx, __hasher $(, $delegate)*) );*
}
}
};
Expand Down

0 comments on commit 5d87272

Please sign in to comment.