diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-09 05:02:21 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-09 05:02:21 +0100 |
| commit | f82049618d67ebd11b4d4596b214007411e2b0b8 (patch) | |
| tree | a3dedcd0b7cc2fb702221c5365789ac0ce2ac19e /src/test/ui/iterators/iter-sum-overflow-overflow-checks.rs | |
| parent | dc834f08ba3ac4dbfade58c8639b933bd81c6a82 (diff) | |
| parent | f0f7b8d44abde324082a91e47f08112f4c0adae8 (diff) | |
| download | rust-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
