Uh oh!
There was an error while loading. Please reload this page.
Update visibility of intermediate use items. - #57922
Conversation
rust-highfive
commented
Jan 26, 2019
r? @oli-obk (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
I've only taken this approach to updating the intermediate use statement as I couldn't find a way to go to it directly from the first use statement. If anyone has a better way of getting to this, I'm happy to change it.
There was a problem hiding this comment.
Oh man, what a hack.
The import -> import -> import -> real definition link is lost after resolve.
The real solution is to calculate AccessLevel::Public and AccessLevel::Exported levels in resolve, while keeping calculating Reachable/ReachableFromImplTrait during the late privacy stage.
It will obviously require changing some infrastructure as well.
There was a problem hiding this comment.
This solution won't work with glob imports (they don't have a name) and also doesn't respect namespaces.
It's an ok approximation, I think we can merge it after adding a couple of FIXMEs describing why it's not entirely correct.
There was a problem hiding this comment.
Would you prefer I attempt to do that in this PR or file a separate issue so that this is followed up on?
Clarified by your later message.
There was a problem hiding this comment.
I've added a FIXME comment.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
oli-obk
commented
Jan 27, 2019
petrochenkov
commented
Jan 27, 2019
@bors r+ |
bors
commented
Jan 27, 2019
📌 Commit b487a4b1c15bfeb0337b079038498ed1d13e5aa8 has been approved by |
bors
commented
Jan 28, 2019
⌛ Testing commit b487a4b1c15bfeb0337b079038498ed1d13e5aa8 with merge c02deb70ed6d7166c91f3aa33831d99cc1c090cd... |
bors
commented
Jan 28, 2019
💔 Test failed - status-appveyor |
Centril
commented
Jan 28, 2019
@bors retry |
This comment has been minimized.
This comment has been minimized.
bors
commented
Jan 28, 2019
⌛ Testing commit b487a4b1c15bfeb0337b079038498ed1d13e5aa8 with merge 3d4225349c6db6f369352904a004cd9abeef9609... |
Dylan-DPC-zz
commented
Jan 28, 2019
ping from triage @petrochenkov waiting for your review on the latest change. |
davidtwco
commented
Jan 28, 2019
@bors r=petrochenkov |
bors
commented
Jan 28, 2019
📌 Commit ad22de4 has been approved by |
Update visibility of intermediate use items. Fixesrust-lang#57410 and fixesrust-lang#53925 and fixesrust-lang#47816. Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This PR ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
Centril
commented
Jan 28, 2019
Failed in rollup, #57955 (comment) (same reason as before). @bors r- Please test locally or with |
davidtwco
commented
Jan 28, 2019
My bad, I had ran tests locally but didn't consider conditional code for other platforms. I'll r+ again when I'm sure it'll be fine. |
Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This commit ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
davidtwco
commented
Feb 2, 2019
I've ran all the tests for this on both Windows and Linux, I think there shouldn't be any issues. |
petrochenkov
commented
Feb 3, 2019
@bors r+ |
bors
commented
Feb 3, 2019
📌 Commit 7102339 has been approved by |
bors
commented
Feb 3, 2019
Update visibility of intermediate use items. Fixes#57410 and fixes#53925 and fixes#47816. Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This PR ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
bors
commented
Feb 3, 2019
☀️ Test successful - checks-travis, status-appveyor |
Fixes#57410 and fixes#53925 and fixes#47816.
Currently, the target of a use statement will be updated with
the visibility of the use statement itself (if the use statement was
visible).
This PR ensures that if the path to the target item is via another
use statement then that intermediate use statement will also have the
visibility updated like the target. This silences incorrect
unreachable_publints with inactionable suggestions.