mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
Add tests for macro in pattern position
This commit is contained in:
parent
97fd517593
commit
0909ecbac7
@ -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) => (),
|
||||
};
|
||||
}
|
||||
|
@ -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
|
||||
) => (),
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user