Commit 97ccd97
authored
Rollup merge of rust-lang#73719 - davidtwco:issue-72509-emitter-column-width, r=estebank
emitter: column width defaults to 140
Fixes rust-lang#72509.
This PR modifies the column width computation in the emitter when `termize::dimensions` returns `None` so that it uses the default value of 140 (which is used in UI testing currently) instead of `usize::MAX` which just ends up causing overflows in later computations.
I also tried changing the computations which used `column_width` with their saturating equivalent, but the output appeared the same - so I decided to go with this approach because I feel like it's less likely to accidentally re-introduce an ICE like this in future (e.g. adding a non-saturating operation on `column_width` in future).
I haven't added a test because I couldn't come up with a MCVE. I stumbled upon this running rustc-perf with the `piston-image` benchmark (running in tmux; it only happened with stage two builds only; and only when running through Cargo, not rustc directly with the same flags). In addition, given the nature of the issue, I don't know that we *could* write a UI test for this. Open to suggestions here though.
r? @estebank1 file changed
+7
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
77 | | - | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| |||
1414 | 1418 | | |
1415 | 1419 | | |
1416 | 1420 | | |
1417 | | - | |
| 1421 | + | |
1418 | 1422 | | |
1419 | 1423 | | |
1420 | 1424 | | |
1421 | | - | |
| 1425 | + | |
1422 | 1426 | | |
1423 | 1427 | | |
1424 | 1428 | | |
| |||
0 commit comments