about summary refs log tree commit diff
path: root/src/test/pretty/if-attr.rs
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-37/+0
2021-12-01Pretty print empty blocks as {}David Tolnay-9/+9
2020-03-04Extent pretty-print testAaron Hill-0/+9
2020-03-04Permit attributes on 'if' expressionsAaron Hill-0/+28
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 {} ```