-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Account for rounding errors when deciding the diagnostic boundaries #64029
Conversation
r? @zackmdavis (rust_highfive has picked a reviewer for you, use r? to override) |
CC @RalfJung |
Properly account for left margin when setting terminal width through CLI flag and don't trim code by default if we can't get the terminal's dimensions.
Also I wonder, is there any way you could add a test for this? (But IMO that's not a blocker.) |
I can confirm that this fixes Miri. r=me with the comment about |
I haven't found why the |
📌 Commit 8456719 has been approved by |
Account for rounding errors when deciding the diagnostic boundaries Fix Miri by fixing the bug raised in rust-lang#63402 (comment). Fixes rust-lang#64020
Rollup of 5 pull requests Successful merges: - #63410 (Update BufWriter example to include call to flush()) - #64029 (Account for rounding errors when deciding the diagnostic boundaries) - #64032 (rustdoc use -Ccodegen-units=1 by default for test compile) - #64039 (Update sync condvar doc style) - #64042 (Fix word repetition in str documentation) Failed merges: r? @ghost
term_size::dimensions().map(|(w, _)| w - code_offset).unwrap_or(140) | ||
term_size::dimensions() | ||
.map(|(w, _)| w.saturating_sub(code_offset)) | ||
.unwrap_or(std::usize::MAX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was this changed to usize::MAX?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bjorn3 If the dimensions aren't supplied and can't be queried, I decided that keeping the current uncropped behavior makes more sense. By setting it to MAX
it'll never crop.
Fix Miri by fixing the bug raised in #63402 (comment).
Fixes #64020