rust/tests/target/issue-2936.rs
Aaron Hill 46ab14437e Don't flatten a block containing a single macro call
We no longer flatten a block that looks like this:

```rust
match val {
    pat => { macro_call!() }
}
```

Currently, rust ignores trailing semicolons in macro expansion in
expression position (see https://github.com/rust-lang/rust/issues/33953)

If this is changed, flattening a block with a macro call may break the
user's code - the trailing semicolon will no longer parse if the macro
call occurs immediately on the right-hand side of the match arm
(e.g. `pat => macro_call!()`)
2020-11-05 20:45:11 -06:00

22 lines
522 B
Rust

struct AStruct {
A: u32,
B: u32,
C: u32,
}
impl Something for AStruct {
fn a_func() {
match a_val {
ContextualParseError::InvalidMediaRule(ref err) => {
let err: &CStr = match err.kind {
ParseErrorKind::Custom(StyleParseErrorKind::MediaQueryExpectedFeatureName(
..,
)) => {
cstr!("PEMQExpectedFeatureName")
}
};
}
};
}
}