rust/tests/ui/binding/match-in-macro.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
288 B
Rust
Raw Normal View History

//@ run-pass
2013-09-10 04:32:10 +00:00
enum Foo {
B { b1: isize, bb1: isize},
2013-09-10 04:32:10 +00:00
}
macro_rules! match_inside_expansion {
2013-09-10 04:32:10 +00:00
() => (
match (Foo::B { b1:29 , bb1: 100}) {
Foo::B { b1:b2 , bb1:bb2 } => b2+bb2
2013-09-10 04:32:10 +00:00
}
)
}
2013-09-10 04:32:10 +00:00
pub fn main() {
2013-09-10 04:32:10 +00:00
assert_eq!(match_inside_expansion!(),129);
}