diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2020-03-09 12:57:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-09 12:57:44 +0100 |
| commit | 4ec997503c94913af44e7f9ec8a75a21c45b7bac (patch) | |
| tree | 116ba3c94f542cf5860f1b7fb38689eca96742ed /src/rustllvm/RustWrapper.cpp | |
| parent | 2cb0b8582ebbf9784db9cec06fff517badbf4553 (diff) | |
| parent | e50fd5a3dc587b5b970b6b969eff7e8547dede70 (diff) | |
| download | rust-4ec997503c94913af44e7f9ec8a75a21c45b7bac.tar.gz rust-4ec997503c94913af44e7f9ec8a75a21c45b7bac.zip | |
Rollup merge of #69201 - Aaron1011:feature/permit-if-attr, r=Centril
Permit attributes on 'if' expressions
Previously, attributes on 'if' expressions (e.g. `#[attr] if true {}`)
were disallowed during parsing. This made it impossible for macros to
perform any custom handling of such attributes (e.g. stripping them
away), since a compilation error would be emitted before they ever had a
chance to run.
This PR permits attributes on 'if' expressions ('if-attrs' from here on).
Both built-in attributes (e.g. `#[allow]`, `#[cfg]`) and proc-macro attributes are supported.
We still do *not* accept attributes on 'other parts' of an if-else
chain. That is, the following code snippet still fails to parse:
```rust
if true {} #[attr] else if false {} else #[attr] if false {} #[attr]
else {}
```
Closes https://github.com/rust-lang/rust/issues/68618
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
