about summary refs log tree commit diff
path: root/src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-09 05:02:21 +0100
committerGitHub <noreply@github.com>2021-12-09 05:02:21 +0100
commitf82049618d67ebd11b4d4596b214007411e2b0b8 (patch)
treea3dedcd0b7cc2fb702221c5365789ac0ce2ac19e /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs
parentdc834f08ba3ac4dbfade58c8639b933bd81c6a82 (diff)
parentf0f7b8d44abde324082a91e47f08112f4c0adae8 (diff)
downloadrust-f82049618d67ebd11b4d4596b214007411e2b0b8.tar.gz
rust-f82049618d67ebd11b4d4596b214007411e2b0b8.zip
Rollup merge of #91568 - dtolnay:breakspace, r=nagisa
Pretty print break and continue without redundant space

**Repro:**

```rust
macro_rules! m {
    ($e:expr) => { stringify!($e) };
}
fn main() {
    println!("{:?}", m!(loop { break; }));
    println!("{:?}", m!(loop { break 'a; }));
    println!("{:?}", m!(loop { break false; }));
}
```

**Before:**

- `"loop { break ; }"`
- `"loop { break 'a ; }"`
- `"loop { break false ; }"`

**After:**

- `"loop { break; }"`
- `"loop { break 'a; }"`
- `"loop { break false; }"`

<br>

Notice that `return` and `yield` already follow the same approach as this PR of printing the space *before* each additional piece following the keyword, rather than *after* each thing.

https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_ast_pretty/src/pprust/state.rs#L2148-L2154

https://github.com/rust-lang/rust/blob/772d51f887fa407216860bf8ecf3f1a32fb795b4/compiler/rustc_ast_pretty/src/pprust/state.rs#L2221-L2228
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs')
0 files changed, 0 insertions, 0 deletions