-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 extern prelude failure in rustdoc #50617
Conversation
This sounds like it could be a bug in the way this error is handled, not necessarily something that we would need to hack around. (And if we do need to patch it specifically for rustdoc, i would prefer using the @Manishearth What do you know about the |
Well, actually_rustdoc doesn't handle the difference between resolution that rustdoc has to do for compilation vs resolution for intra doc links. |
Hmm, that's a good point, since this PR currently only enables the setting after the rest of the crate has passed resolution. Still, i'm wondering whether there's a "proper" fix that's not "disable this check during intra-link resolution". What's actually going on here? |
Actually the proper fix is make it such that we hit that call with record_used=true, since record_used is also "is this a speculative resolution" which is true in this case. Perhaps rename the parameter while you're at it. Elsewhere I've proposed a more coherent abstraction for paths that also includes speculation but it's currently stalled on a decision from compiler folks think. |
☔ The latest upstream changes (presumably #50235) made this pull request unmergeable. Please resolve the merge conflicts. |
050a958
to
27db90a
Compare
Ping from triage @QuietMisdreavus! This PR needs your review. |
I think we still needed to discuss what it would take to get to the solution @Manishearth mentioned. I'm not a fan of adding a new flag just to toss it into an existing if-clause somewhere. |
Me neither so an alternative solution would come in handy. |
@QuietMisdreavus / @GuillaumeGomez: How do you plan to move forward with this PR? |
We haven't talked about it since then (rustfest). We will come back to it. |
For when this is ready to go, @bors p=1 We should also make sure to backport this if necessary -- I've put the related issue on the tracking milestone (edit: to be clear, for now it's not necessary, but this may slip into beta). |
Should we merge this meanwhile writing a better version? |
Reading over this again, i'm willing to have the temp flag (even though i'm concerned it may not stay temporary). However, the location of the check should probably be moved. Right now, what this is doing is universally enabling the In fact, reading this over again, it looks like we can bypass the need for the new flag by moving the feature-flag check. Would it be possible to reconfigure this so that the block with I've changed my mind a few times while writing this, but basically i want to make sure we don't eagerly use the |
Temporary flag to avoid a feature gate error is okay, but I'd like to avoid this:
We did the breaking change once in #49789 making sure it caused no regressions and now people can't write code that would conflict with extern prelude when it's stabilized. |
@petrochenkov I'm not sure what you're suggesting. Are you wanting to keep this PR as-is, or make it do something different? |
"As is" LGTM. |
Works for me! I was worried about exposing the feature more widely than it otherwise would have been, but if you're worried about breaking more code when it's fully stabilized, i won't hold it up. Thanks for commenting! @bors r+ |
📌 Commit 27db90a has been approved by |
…r=QuietMisdreavus Fix extern prelude failure in rustdoc Fixes rust-lang#50561. r? @QuietMisdreavus
🔒 Merge conflict |
27db90a
to
dadfa13
Compare
Rebased (and no conflicts of course...). @bors: r=QuietMisdreavus |
📌 Commit dadfa13 has been approved by |
…reavus Fix extern prelude failure in rustdoc Fixes #50561. r? @QuietMisdreavus
☀️ Test successful - status-appveyor, status-travis |
Fixes #50561.
r? @QuietMisdreavus