-
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
Fix rustdoc ICE on macros defined within functions #47959
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
4e9252e
to
a5d388c
Compare
src/test/rustdoc/issue-47639.rs
Outdated
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
// This should not ICE |
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.
[00:05:40] tidy error: /checkout/src/test/rustdoc/issue-47639.rs:11: trailing whitespace
a5d388c
to
ee737c7
Compare
fixed
…-Manish Goregaokar
On Fri, Feb 2, 2018 at 1:31 PM, kennytm ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/test/rustdoc/issue-47639.rs
<#47959 (comment)>:
> @@ -0,0 +1,16 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// This should not ICE
[00:05:40] tidy error: /checkout/src/test/rustdoc/issue-47639.rs:11: trailing whitespace
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#47959 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABivSAdPD_KY9FC_ZBJaYRJvbqgd_uiRks5tQsDNgaJpZM4R2vx4>
.
|
Seeking a second opinion. Does someone on @rust-lang/compiler have a better grasp of the ramifications of turning off the "buffered-but-not-fired lints are bugs" functionality when running as rustdoc? @jseyfried? Something about "just patching out the line that panics" seems off, but then again the "everybody loops" pass is also a bit strange, so maybe it balances out. |
The assumption made in that A more robust solution would be to note down the macros removed by everybody-loops but imo that's a bit like overkill. |
Could we instead gate this check on whether everybody loops pass was run? Not sure whether that's better necessarily, but it seems at least like a minor improvement. |
Where should I stash that fact? On the session? On the context?
One trick that could be done is to empty that buffer immediately after
running the pass, or turn off the unused macro built-in for rustdoc.
…On Feb 2, 2018 11:59 PM, "Mark Simulacrum" ***@***.***> wrote:
Could we instead gate this check on whether everybody loops pass was run?
Not sure whether that's *better* necessarily, but it seems at least like
a minor improvement.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#47959 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABivSO07T0VL1qvEYSTiaWRBeRQ2LUkjks5tQ1GugaJpZM4R2vx4>
.
|
Hm. Yeah, let's not change anything then unless the compiler team decides on something. Is there a chance you could prepare a PR to backport this (minimal) fix to beta? It seems like the smallest change we can make that should fix this regression and I'd like to get it on beta ASAP. |
done: #47969 won't be around for a while, feel free to force push to that branch or whatever to get it landed |
// node ids to not exist (e.g. macros defined within functions for the | ||
// unused_macro lint) anymore. So we only run this check | ||
// when we're not in rustdoc mode. (see issue #47639) | ||
if !sess.opts.actually_rustdoc { |
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.
actually_rustdoc
is pre-existing?!
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 this is not CLI-facing, just an internal flag used for literally causing the problem here.
Backport rustdoc ICE fixes to beta backport of #47959
Anyway, r? We've landed the beta one so this isn't urgent anymore but nightly is still broken. |
I think we should land this and perhaps iterate later if necessary. If anyone objects, feel free to r- @bors r+ |
📌 Commit ee737c7 has been approved by |
…ulacrum Fix rustdoc ICE on macros defined within functions fixes rust-lang#47639
fixes #47639