-
Notifications
You must be signed in to change notification settings - Fork 523
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
Add -Ztrack-diagnostics information #1506
Conversation
src/compiler-debugging.md
Outdated
`-Z track-diagnostics` can help figure out where errors are emitted. It uses `#[track_caller]` | ||
for this and prints its location alongside the error: | ||
|
||
```bash |
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.
I would not add this since what follows is not shell code, just console output... would indeed be nice to have colors matching rustc error messages.
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.
I went with consistency with the treat-bug-as-err example above, which also uses bash syntax to set env variables
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.
you may fix that as well if you like
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.
Done
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.
I would not separate commands and their outputs as you did, especially since it does not help with highlighting at all. I can make the changes for you, if you feel like this is too much back-n-forth.
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.
Sorry for the delay - I somewhat forgot about this Pr. I think the current separation is fine. Feel free to change it if you disagree.
src/diagnostics.md
Outdated
@@ -287,6 +287,8 @@ There are two main ways to find where a given error is emitted: | |||
- The _construction_ of the error is far away from where it is _emitted_, | |||
a problem similar to the one we faced with the `grep` approach. | |||
In some cases, we buffer multiple errors in order to emit them in order. | |||
- Invoking `rustc` with the nightly-only flag `-Z track-diagnostics` will print error creation |
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.
- Invoking `rustc` with the nightly-only flag `-Z track-diagnostics` will print error creation | |
- Invoking `rustc` with the nightly-only flag, `-Z track-diagnostics`, will print error creation |
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.
I'm not sure that makes sense, but I'm not a native speaker. I went for consistency with treat-bug-as-err, which does not have commas in this position.
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.
You can, alternatively, do this (which avoids the commas)...
Invoking
rustc
with-Z track-diagnostics
will print error creation
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.
Thanks, that is much nicer
GitHub ui failed me here, and does not seem to offer a way to fix it... @mejrs will you please fix my mess (replace the missing backticks on the code blocks). Please rebase as well. |
0a337f0
to
776f114
Compare
Done. I'm not sure I understood what you wanted though... |
Update books ## rust-lang/nomicon 1 commits in ae406aa5287a9e025abb72343aaceec98458c117..dd37e21ccee43918ed18a71581bb2af537ffe4fc 2022-12-09 22:04:38 UTC to 2022-12-09 22:04:38 UTC - Update lifetime-mismatch.md (rust-lang/nomicon#387) ## rust-lang/rust-by-example 3 commits in a9869b4a3c4cac3bc6099b41f088679e268400b8..995df09b65c582eb6290ab7ea5d9485983eb4c37 2022-12-08 23:29:31 UTC to 2022-12-08 23:28:31 UTC - Add documentation for let-else. (rust-lang/rust-by-example#1640) - Added missing space in comment (rust-lang/rust-by-example#1644) - Clean up Chapter 1 (Hello World) (rust-lang/rust-by-example#1650) ## rust-lang/rustc-dev-guide 8 commits in e269950..8b42eb5 2022-12-17 22:41:27 UTC to 2022-12-07 05:42:57 UTC - Add -Ztrack-diagnostics information (rust-lang/rustc-dev-guide#1506) - Add documentation for LLVM KCFI support (rust-lang/rustc-dev-guide#1529) - Replace references to NoLandingPads in MIR pass documents (rust-lang/rustc-dev-guide#1531) - share same link (rust-lang/rustc-dev-guide#1530) - chore: Update `actions/github-script` to v6 (rust-lang/rustc-dev-guide#1521) - fix: Fix broken links (rust-lang/rustc-dev-guide#1522) - Remove TyS (rust-lang/rustc-dev-guide#1526) - Fix small inaccuracy in monomorph page (rust-lang/rustc-dev-guide#1525)
Followup to rust-lang/rust#103217