about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-03-09 12:57:44 +0100
committerGitHub <noreply@github.com>2020-03-09 12:57:44 +0100
commit4ec997503c94913af44e7f9ec8a75a21c45b7bac (patch)
tree116ba3c94f542cf5860f1b7fb38689eca96742ed /src/rustllvm/RustWrapper.cpp
parent2cb0b8582ebbf9784db9cec06fff517badbf4553 (diff)
parente50fd5a3dc587b5b970b6b969eff7e8547dede70 (diff)
downloadrust-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