diff --git a/tests/source/macros.rs b/tests/source/macros.rs index 8c57ff4a4dd..db3c04f0d9b 100644 --- a/tests/source/macros.rs +++ b/tests/source/macros.rs @@ -284,3 +284,19 @@ impl Foo { /// foo pub fn foo(&self) -> Bar<foo!( )> {} } + +// #819 +fn macro_in_pattern_position () { + let x = match y { + foo!( ) => (), + bar!( a, b, + c) => (), + bar!(a + , b + , c + ,) => (), + baz!( 1 + 2 + 3, quux.kaas( ) + ) => (), + quux!(AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB) => (), + }; +} diff --git a/tests/target/macros.rs b/tests/target/macros.rs index 22b0286c766..6897d4c8796 100644 --- a/tests/target/macros.rs +++ b/tests/target/macros.rs @@ -808,3 +808,17 @@ impl Foo { /// foo pub fn foo(&self) -> Bar<foo!()> {} } + +// #819 +fn macro_in_pattern_position() { + let x = match y { + foo!() => (), + bar!(a, b, c) => (), + bar!(a, b, c,) => (), + baz!(1 + 2 + 3, quux.kaas()) => (), + quux!( + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, + BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB + ) => (), + }; +}