diff --git a/tests/source/big-impl.rs b/tests/source/big-impl.rs new file mode 100644 index 00000000000..c36b7e6cadb --- /dev/null +++ b/tests/source/big-impl.rs @@ -0,0 +1,104 @@ +// #1357 +impl< + 'a, + Select, + From, + Distinct, + Where, + Order, + Limit, + Offset, + Groupby, + DB, +> InternalBoxedDsl<'a, DB> + for SelectStatement< + Select, + From, + Distinct, + Where, + Order, + Limit, + Offset, + GroupBy, + > where + DB: Backend, + Select: QueryFragment + SelectableExpression + 'a, + Distinct: QueryFragment + 'a, + Where: Into + 'a>>>, + Order: QueryFragment + 'a, + Limit: QueryFragment + 'a, + Offset: QueryFragment + 'a, +{ + type Output = BoxedSelectStatement<'a, Select::SqlTypeForSelect, From, DB>; + + fn internal_into_boxed(self) -> Self::Output { + BoxedSelectStatement::new( + Box::new(self.select), + self.from, + Box::new(self.distinct), + self.where_clause.into(), + Box::new(self.order), + Box::new(self.limit), + Box::new(self.offset), + ) + } +} + +// #1369 +impl< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> Foo for Bar { + fn foo() {} +} +impl Foo< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> for Bar { + fn foo() {} +} +impl< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> Foo< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> for Bar { + fn foo() {} +} +impl< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> Foo for Bar< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> { + fn foo() {} +} +impl Foo< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> for Bar< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, +> { + fn foo() {} +} +impl Foo + for Bar { + fn foo() {} +} diff --git a/tests/source/impls.rs b/tests/source/impls.rs index 1c38a2ff284..17588fb9d35 100644 --- a/tests/source/impls.rs +++ b/tests/source/impls.rs @@ -122,3 +122,20 @@ impl Issue1249 Drop for RawTable { fn drop() {} } + +// #1168 +pub trait Number: Copy + Eq + Not + Shl + + Shr + + BitAnd + BitOr + BitAndAssign + BitOrAssign + + + +{ + // test + fn zero() -> Self; +} + +// #1642 +pub trait SomeTrait : Clone + Eq + PartialEq + Ord + PartialOrd + Default + Hash + Debug + Display + Write + Read + FromStr { + // comment +} diff --git a/tests/target/big-impl-rfc.rs b/tests/target/big-impl-rfc.rs index 18fa59cb5a0..108968faaed 100644 --- a/tests/target/big-impl-rfc.rs +++ b/tests/target/big-impl-rfc.rs @@ -5,7 +5,7 @@ // #1357 impl<'a, Select, From, Distinct, Where, Order, Limit, Offset, Groupby, DB> InternalBoxedDsl<'a, DB> -for SelectStatement + for SelectStatement where DB: Backend, Select: QueryFragment + SelectableExpression + 'a, @@ -32,11 +32,11 @@ where // #1369 impl Foo -for Bar { + for Bar { fn foo() {} } impl Foo -for Bar { + for Bar { fn foo() {} } impl< @@ -44,15 +44,23 @@ impl< ExcessivelyLongGenericName, AnotherExcessivelyLongGenericName, > Foo -for Bar { + for Bar { fn foo() {} } impl Foo -for Bar { + for Bar< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, + > { fn foo() {} } impl Foo -for Bar { + for Bar< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, + > { fn foo() {} } impl< @@ -60,6 +68,10 @@ impl< ExcessivelyLongGenericName, AnotherExcessivelyLongGenericName, > Foo -for Bar { + for Bar< + ExcessivelyLongGenericName, + ExcessivelyLongGenericName, + AnotherExcessivelyLongGenericName, + > { fn foo() {} } diff --git a/tests/target/big-impl.rs b/tests/target/big-impl.rs new file mode 100644 index 00000000000..afe2571ec68 --- /dev/null +++ b/tests/target/big-impl.rs @@ -0,0 +1,62 @@ +// #1357 +impl<'a, Select, From, Distinct, Where, Order, Limit, Offset, Groupby, DB> InternalBoxedDsl<'a, DB> + for SelectStatement + where DB: Backend, + Select: QueryFragment + SelectableExpression + 'a, + Distinct: QueryFragment + 'a, + Where: Into + 'a>>>, + Order: QueryFragment + 'a, + Limit: QueryFragment + 'a, + Offset: QueryFragment + 'a +{ + type Output = BoxedSelectStatement<'a, Select::SqlTypeForSelect, From, DB>; + + fn internal_into_boxed(self) -> Self::Output { + BoxedSelectStatement::new(Box::new(self.select), + self.from, + Box::new(self.distinct), + self.where_clause.into(), + Box::new(self.order), + Box::new(self.limit), + Box::new(self.offset)) + } +} + +// #1369 +impl Foo + for Bar { + fn foo() {} +} +impl Foo + for Bar { + fn foo() {} +} +impl Foo for Bar { + fn foo() {} +} +impl Foo + for Bar { + fn foo() {} +} +impl Foo + for Bar { + fn foo() {} +} +impl Foo + for Bar { + fn foo() {} +} diff --git a/tests/target/impls.rs b/tests/target/impls.rs index f8b9f43aeb0..654d4be8967 100644 --- a/tests/target/impls.rs +++ b/tests/target/impls.rs @@ -126,8 +126,8 @@ mod m { impl PartialEq for S where T: PartialEq {} } -impl Handle, - HandleType> { +impl + Handle, HandleType> { } impl PartialEq @@ -154,3 +154,35 @@ impl impl<#[may_dangle] K, #[may_dangle] V> Drop for RawTable { fn drop() {} } + +// #1168 +pub trait Number + : Copy + + Eq + + Not + + Shl + + Shr + + BitAnd + + BitOr + + BitAndAssign + + BitOrAssign { + // test + fn zero() -> Self; +} + +// #1642 +pub trait SomeTrait + : Clone + + Eq + + PartialEq + + Ord + + PartialOrd + + Default + + Hash + + Debug + + Display + + Write + + Read + + FromStr { + // comment +}