Add an attribute-related parenthesization edge case
This commit is contained in:
parent
12a855d2c8
commit
535e11f72e
1 changed files with 6 additions and 0 deletions
|
|
@ -101,6 +101,12 @@ static EXPRS: &[&str] = &[
|
|||
"#[attr] (x += 1)",
|
||||
"#[attr] (lo..hi)",
|
||||
"#[attr] (..hi)",
|
||||
// If the attribute were not present on the binary operation, it would be
|
||||
// legal to render this without not just the inner parentheses, but also the
|
||||
// outer ones. `return x + .. .field` (Yes, really.) Currently the
|
||||
// pretty-printer does not take advantage of this edge case.
|
||||
"(return #[attr] (x + ..)).field",
|
||||
"(return x + ..).field",
|
||||
// Grammar restriction: break value starting with a labeled loop is not
|
||||
// allowed, except if the break is also labeled.
|
||||
"break 'outer 'inner: loop {} + 2",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue