From 0a3c097339d3448f8dcab9aa3c0a9b1345e5cebd Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Tue, 23 Mar 2021 12:08:50 -0300 Subject: Fix bug preventing multiple impl trait in a row --- tests/09-multiple-traits.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/09-multiple-traits.rs (limited to 'tests/09-multiple-traits.rs') diff --git a/tests/09-multiple-traits.rs b/tests/09-multiple-traits.rs new file mode 100644 index 0000000..d75ab31 --- /dev/null +++ b/tests/09-multiple-traits.rs @@ -0,0 +1,26 @@ +// Checks that multiple `impl trait` in a row are valid. + +use impl_trait::impl_trait; + +struct Foo; +trait Bar { +} +trait Baz { +} + +impl_trait! { + impl Foo { + impl trait Bar { + } + 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