forked from mirror/async-std
Merge pull request #555 from stjepang/optimize-cargo-check
Macro optimization to reduce compilation times
This commit is contained in:
commit
c6622475b2
1 changed files with 5 additions and 0 deletions
|
@ -221,6 +221,11 @@ macro_rules! extension_trait {
|
||||||
$(#[cfg(feature = "docs")] $imp)*
|
$(#[cfg(feature = "docs")] $imp)*
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Optimization: expand `$head` eagerly before starting a new method definition.
|
||||||
|
(@ext ($($head:tt)*) #[doc = $d:literal] $($tail:tt)*) => {
|
||||||
|
$($head)* extension_trait!(@ext (#[doc = $d]) $($tail)*);
|
||||||
|
};
|
||||||
|
|
||||||
// Parse the return type in an extension method.
|
// Parse the return type in an extension method.
|
||||||
(@doc ($($head:tt)*) -> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*) => {
|
(@doc ($($head:tt)*) -> impl Future<Output = $out:ty> $(+ $lt:lifetime)? [$f:ty] $($tail:tt)*) => {
|
||||||
extension_trait!(@doc ($($head)* -> owned::ImplFuture<$out>) $($tail)*);
|
extension_trait!(@doc ($($head)* -> owned::ImplFuture<$out>) $($tail)*);
|
||||||
|
|
Loading…
Reference in a new issue