From a0f77cbba537514f84f64c5be660f2bdcd69782f Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Thu, 22 Apr 2021 11:10:09 -0300 Subject: Fix things not being cleaned up correctly --- tests/11-traits-generics-docs.rs | 28 ++++++++++++++++++++++++++++ tests/progress.rs | 1 + 2 files changed, 29 insertions(+) create mode 100644 tests/11-traits-generics-docs.rs (limited to 'tests') diff --git a/tests/11-traits-generics-docs.rs b/tests/11-traits-generics-docs.rs new file mode 100644 index 0000000..7d6ab6e --- /dev/null +++ b/tests/11-traits-generics-docs.rs @@ -0,0 +1,28 @@ +// Checks that multiple `impl trait` in a row are valid, with generics and docs. + +use impl_trait::impl_trait; + +struct Foo(T); +trait Bar { +} +trait Baz { +} + +impl_trait! { + impl Foo { + /// ABC + impl trait Bar { + } + /// DEF + impl trait Baz { + } + } +} + +fn static_assert_1(_t: T) {} +fn static_assert_2(_t: T) {} + +fn main() { + static_assert_1(Foo(())); + static_assert_2(Foo(())); +} diff --git a/tests/progress.rs b/tests/progress.rs index 74c5774..5a1bdb6 100644 --- a/tests/progress.rs +++ b/tests/progress.rs @@ -11,6 +11,7 @@ fn tests() { t.pass("tests/08-inherent-docs.rs"); t.pass("tests/09-multiple-traits.rs"); t.pass("tests/10-multiple-traits-with-generics.rs"); + t.pass("tests/11-traits-generics-docs.rs"); t.pass("tests/98-readme.rs"); t.pass("tests/99-goal.rs"); } -- cgit 1.4.1