-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 -Z dont-buffer-diagnostics
#54232
add -Z dont-buffer-diagnostics
#54232
Conversation
r? @eddyb (rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/ty/context.rs
Outdated
/// Either immediate signals the given diagnostic, or puts it on the | ||
/// given `buffer` for later signalling in the future. | ||
pub fn buffer(self, mut diag: DiagnosticBuilder, buffer: &mut Vec<Diagnostic>) { | ||
if self.sess.opts.debugging_opts.dont_buffer_diagnostics { |
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 believe this should check treat-err-as-bug
and abort. And/or you could probably make this:
if self.sess.opts.debugging_opts.treat_err_as_bug || self.sess.opts.debugging_opts.dont_buffer_diagnostics {
I've applied this patch myself numerous times.
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.
Oh, wait, no I haven't. I think this function is in the wrong place. This code can live in buffer()
-- it has access to the Handler
, which has the field flags
(of type HandlerFlags
) that contain flags relevant to it. We can just add this flag in there.
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.
Ok will do (probably on Monday)
@@ -457,7 +457,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> { | |||
} | |||
} | |||
|
|||
err.buffer(&mut self.errors_buffer); | |||
self.tcx.buffer(err, &mut self.errors_buffer); |
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.
all these diffs aren't needed then
d5d957d
to
d466964
Compare
-Z dont-buffer-diagnostics
-Z dont-buffer-diagnostics
(this does not seem to yet work in the manner I intended.) Update: 🤕 while incorporating review feedback, I felt out crucial invocation of |
…t its diagnostics. This is mainly intended for `rustc` developers who want to see a diagnostic in its original context in the control flow. Two uses cases for that are: * `-Z treat-err-as-bug` which then allows extraction of a stack-trace to the origin of the error (a case that is so important that we make that flag imply this one, effectively). * `RUST_LOG=... rustc`, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled. Drive-by: Added some documentation pointing future devs at HandlerFlags, and documented the fields of `HandlerFlags` itself.
d466964
to
82e1750
Compare
@bors r+ |
📋 Looks like this PR is still in progress, ignoring approval. Hint: Remove [WIP] from this PR's title when it is ready for review. |
@bors rollup |
-Z dont-buffer-diagnostics
-Z dont-buffer-diagnostics
@bors r+ rollup |
📌 Commit 82e1750 has been approved by |
…tic-buffering, r=nikomatsakis add `-Z dont-buffer-diagnostics` Add `-Z dont-buffer-diagnostics`, a way to force NLL to immediately its diagnostics. This is mainly intended for developers who want to see the error in its original context in the control flow. Two uses cases for that are: 1. `-Z treat-err-as-bug` (which then allows extraction of a stack-trace to the origin of the error) 2. RUST_LOG=... rustc, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled.
Rollup of 9 pull requests Successful merges: - #53522 (Add doc for impl From for Addr) - #54097 (rustdoc: Remove namespace for keywords) - #54205 (Add treat-err-as-bug flag in rustdoc) - #54225 (Regression test for #53675.) - #54232 (add `-Z dont-buffer-diagnostics`) - #54273 (Suggest to change numeric literal instead of casting) - #54299 (Issue 54246) - #54311 (Remove README with now-out-of-date docs about docs.) - #54313 (OsStr: Document that it's not NUL terminated) Failed merges: r? @ghost
It was added in rust-lang#54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary.
…stics, r=compiler-errors Remove `-Zdont-buffer-diagnostics`. It was added in rust-lang#54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary. r? `@pnkfelix`
It was added in rust-lang#54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary.
…stics, r=compiler-errors Remove `-Zdont-buffer-diagnostics`. It was added in rust-lang#54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary. r? `@pnkfelix`
…stics, r=compiler-errors Remove `-Zdont-buffer-diagnostics`. It was added in rust-lang#54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary. r? ``@pnkfelix``
Rollup merge of rust-lang#119723 - nnethercote:rm-Zdont-buffer-diagnostics, r=compiler-errors Remove `-Zdont-buffer-diagnostics`. It was added in rust-lang#54232. It seems like it was aimed at NLL development, which is well in the past. Also, it looks like `-Ztreat-err-as-bug` can be used to achieve the same effect. So it doesn't seem necessary. r? ``@pnkfelix``
Add
-Z dont-buffer-diagnostics
, a way to force NLL to immediately its diagnostics.This is mainly intended for developers who want to see the error in its original context in the control flow. Two uses cases for that are:
-Z treat-err-as-bug
(which then allows extraction of a stack-trace to the origin of the error)RUST_LOG=... rustc, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled.