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 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/11-traits-generics-docs.rs (limited to 'tests/11-traits-generics-docs.rs') 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(())); +} -- cgit 1.4.1