From efa182fc6895ad25d2c1a716f4452fb0040a9eaf Mon Sep 17 00:00:00 2001 From: Georg Semmler Date: Tue, 3 May 2022 22:39:22 +0200 Subject: [PATCH] Implement a similar change for the SqlType impls This does **increase** the build time drastically. For me a build with `cargo check --no-default-features --features "sqlite"` (so no large number of supported columns!) takes nearly 13 minutes. This is obviously not acceptable. --- diesel/src/type_impls/tuples.rs | 43 +++++---------------------------- 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/diesel/src/type_impls/tuples.rs b/diesel/src/type_impls/tuples.rs index d35f4a597f40..38eda1c23c83 100644 --- a/diesel/src/type_impls/tuples.rs +++ b/diesel/src/type_impls/tuples.rs @@ -482,45 +482,14 @@ macro_rules! impl_valid_grouping_for_tuple_of_columns { } macro_rules! impl_sql_type { - ( - @build - start_ts = [$($ST: ident,)*], - ts = [$T1: ident,], - bounds = [$($bounds: tt)*], - is_null = [$($is_null: tt)*], - )=> { - impl<$($ST,)*> SqlType for ($($ST,)*) + ($T1: ident, $($T: ident,)+) => { + impl<$T1, $($T,)*> SqlType for ($T1, $($T,)*) where - $($ST: SqlType,)* - $($bounds)* - $T1::IsNull: OneIsNullable<$($is_null)*>, + $T1: SqlType, + ($($T,)*): SqlType, + $T1::IsNull: OneIsNullable<<($($T,)*) as SqlType>::IsNull>, { - type IsNull = <$T1::IsNull as OneIsNullable<$($is_null)*>>::Out; - } - - }; - ( - @build - start_ts = [$($ST: ident,)*], - ts = [$T1: ident, $($T: ident,)+], - bounds = [$($bounds: tt)*], - is_null = [$($is_null: tt)*], - )=> { - impl_sql_type!{ - @build - start_ts = [$($ST,)*], - ts = [$($T,)*], - bounds = [$($bounds)* $T1::IsNull: OneIsNullable<$($is_null)*>,], - is_null = [<$T1::IsNull as OneIsNullable<$($is_null)*>>::Out], - } - }; - ($T1: ident, $($T: ident,)+) => { - impl_sql_type!{ - @build - start_ts = [$T1, $($T,)*], - ts = [$($T,)*], - bounds = [], - is_null = [$T1::IsNull], + type IsNull = <$T1::IsNull as OneIsNullable<<($($T,)*) as SqlType>::IsNull>>::Out; } }; ($T1: ident,) => {