-
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
Tracking Issue for -Z terminal-width
#84673
Comments
cc @rust-lang/wg-diagnostics Hope you don't mind I open this. If anyone knows of any unresolved questions or blockers for this, I would appreciate if you could update the issue (or perhaps there is no desire to carry this forward?). |
I wanted this feature to be able to automatically format errors to a width suitable for inclusion on slides. However, it does not:
Should I register this as a separate issue? |
That should indeed be a separate issue, I think. It is related, but independent. I also know it will be very difficult to come up with a good layout algorithm :-/ For things like slides, I think a better option would be html output. |
I think that we should go ahead with stabilizing this, it's a small compiler feature that hasn't seen any major changes since it was implemented, and is useful for people invoking rustc through build systems other than Cargo. Stabilization PR: #95635 @rfcbot fcp merge Brief summaryrustc currently detects the width of the terminal and will truncate diagnostic output when it includes source code lines which are longer than the terminal width.
However, rustc is unable to detect the terminal width when it is being invoked indirectly (i.e. through a build tool like Cargo). Implementation History
Test Coverage
FAQ1. Is a flag necessary to turn this behaviour off?
Having this flag on stable won't change any behaviour, just allow tools to tell rustc the terminal width. 2. Can the terminal width be determined through environment variables? Outstanding bugs
Notes
|
Team member @davidtwco has proposed to merge this. The next step is review by the rest of the tagged team members:
No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@rfcbot reviewed |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
…ion, r=oli-obk sess: stabilize `--terminal-width` as `--diagnostic-width` Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Pending agreement to stabilize, see tracking issue at rust-lang#84673. r? `@oli-obk`
…ion, r=oli-obk sess: stabilize `--terminal-width` as `--diagnostic-width` Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Pending agreement to stabilize, see tracking issue at rust-lang#84673. r? ``@oli-obk``
…ion, r=oli-obk sess: stabilize `--terminal-width` as `--diagnostic-width` Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Pending agreement to stabilize, see tracking issue at rust-lang#84673. r? ```@oli-obk```
Stabilization pull request has landed at #95635. |
Thanks @davidtwco! I posted rust-lang/cargo#10833 to fix Cargo's tests. I'd like to discuss how this interface works in Cargo. I'm wondering if we should provide any sort of option to allow the user to force the width over the auto-detected version? Currently Cargo has the
I kinda lean towards option 3, but I dislike adding too many configuration options. Does anyone have any thoughts? cc @rust-lang/cargo |
Update terminal-width flag. The rustc flag `-Zterminal-width` has been stabilized as `--terminal-width` in rust-lang/rust#95635. This updates cargo to use the new flag so that tests will pass. Tests won't pass until the next nightly is published in about 10 hours from now. I just wanted to post this to get ahead of the breaking change. This doesn't stabilize in cargo because that will take more time, and this is needed to prevent CI from failing. Will continue the stabilization discussion at rust-lang/rust#84673.
Status: The
rustc
side has been stabilized in 1.64 as the--diagnostic-width
option. This tracking issue is still open for the cargo side of changes. See #84673 (comment).This is a tracking issue for the
-Z terminal-width
flag. This flag tellsrustc
the width of the terminal so that it can truncate long lines in diagnostic output to the correct length. A corresponding flag of the same name is available in Cargo, which detects the terminal width and sends in the appropriate value torustc
.Unresolved Questions
Unknown.
Implementation history
-Z terminal-width
. cargo#8427-Zterminal-width
as--diagnostic-width
#95635About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
The text was updated successfully, but these errors were encountered: