Skip to content

Commit

Permalink
Fix lifetime ordering in serialize_trait_object
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 16, 2022
1 parent 6b6bde1 commit 945302f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,14 @@ macro_rules! __internal_serialize_trait_object {
$crate::__internal_serialize_trait_object!(path () ($first) $($rest)*);
};

// End of generics.
// End of generics with trailing comma.
(generics ($($generics:tt)*) () , > $($rest:tt)*) => {
$crate::__internal_serialize_trait_object!(path ($($generics)* ,) () $($rest)*);
};

// End of generics without trailing comma.
(generics ($($generics:tt)*) () > $($rest:tt)*) => {
$crate::__internal_serialize_trait_object!(path ($($generics)*) () $($rest)*);
$crate::__internal_serialize_trait_object!(path ($($generics)* ,) () $($rest)*);
};

// Generics open bracket.
Expand Down Expand Up @@ -80,7 +85,7 @@ macro_rules! __internal_serialize_trait_object {
// Expand into four impls.
(sendsync ($($generics:tt)*) ($($path:tt)*) ($($bound:tt)*)) => {
$crate::__internal_serialize_trait_object!(impl ($($generics)*) ($($path)*) ($($bound)*) {
fn __check_erased_serialize_supertrait<__T, $($generics)*>()
fn __check_erased_serialize_supertrait<$($generics)* __T>()
where
__T: ?$crate::private::Sized + $($path)*,
$($bound)*
Expand Down

0 comments on commit 945302f

Please sign in to comment.