mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-04-28 06:07:58 +00:00
Fix concurrency issues (#142)
* Fix the OS FD error * Cache the compiler versions * Allow for auto display impl in declare wrapper type macro * Better logging and fix concurrency issues * Fix tests * Format * Make the code even more concurrent
This commit is contained in:
@@ -1,3 +1,14 @@
|
||||
#[macro_export]
|
||||
macro_rules! impl_for_wrapper {
|
||||
(Display, $ident: ident) => {
|
||||
impl std::fmt::Display for $ident {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
std::fmt::Display::fmt(&self.0, f)
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// Defines wrappers around types.
|
||||
///
|
||||
/// For example, the macro invocation seen below:
|
||||
@@ -42,7 +53,13 @@
|
||||
macro_rules! define_wrapper_type {
|
||||
(
|
||||
$(#[$meta: meta])*
|
||||
$vis:vis struct $ident: ident($ty: ty);
|
||||
$vis:vis struct $ident: ident($ty: ty)
|
||||
|
||||
$(
|
||||
impl $($trait_ident: ident),*
|
||||
)?
|
||||
|
||||
;
|
||||
) => {
|
||||
$(#[$meta])*
|
||||
$vis struct $ident($ty);
|
||||
@@ -98,9 +115,15 @@ macro_rules! define_wrapper_type {
|
||||
value.0
|
||||
}
|
||||
}
|
||||
|
||||
$(
|
||||
$(
|
||||
$crate::macros::impl_for_wrapper!($trait_ident, $ident);
|
||||
)*
|
||||
)?
|
||||
};
|
||||
}
|
||||
|
||||
/// Technically not needed but this allows for the macro to be found in the `macros` module of the
|
||||
/// crate in addition to being found in the root of the crate.
|
||||
pub use define_wrapper_type;
|
||||
pub use {define_wrapper_type, impl_for_wrapper};
|
||||
|
||||
Reference in New Issue
Block a user