diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2020-02-15 19:04:20 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2020-03-04 16:43:13 -0500 |
| commit | f63b88c761f935d9b2c220a1b4e3abf0c0681c69 (patch) | |
| tree | d02b16b4610ac00c024fa8a6620183f9465f4088 /src/test/incremental/thinlto | |
| parent | 2b0cfa5b4c5099f45ca540ee1c7d8c1ecd5267d2 (diff) | |
| download | rust-f63b88c761f935d9b2c220a1b4e3abf0c0681c69.tar.gz rust-f63b88c761f935d9b2c220a1b4e3abf0c0681c69.zip | |
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]`) 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 {}
```
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
