Skip to content
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 visible_parent_map to choose globally minimal paths #46708

Merged
merged 2 commits into from
Dec 14, 2017

Conversation

pnkfelix
Copy link
Member

Fix #46112: visible_parent_map construction needs a BFS over whole crate forest to get globally minimal paths.

(There are other latent bugs that were e.g. causing this test case to have weirdness like <unnamed> in the diagnostic output. Those bugs are not fixed here, since they are issues long-standing in the stable channel.)

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@pnkfelix
Copy link
Member Author

r? @arielb1

@pnkfelix pnkfelix added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. beta-nominated Nominated for backporting to the compiler in the beta channel. labels Dec 13, 2017
@pnkfelix
Copy link
Member Author

@arielb1 should I give this to @alexcrichton to review instead? Who is best here?

@pnkfelix
Copy link
Member Author

r? @alexcrichton

@arielb1
Copy link
Contributor

arielb1 commented Dec 13, 2017

This is a beta regression, so:

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Dec 13, 2017

📌 Commit 35bcd99 has been approved by arielb1

@bors
Copy link
Contributor

bors commented Dec 13, 2017

🌲 The tree is currently closed for pull requests below priority 2, this pull request will be tested once the tree is reopened

@kennytm kennytm added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 13, 2017
@bors
Copy link
Contributor

bors commented Dec 13, 2017

⌛ Testing commit 35bcd99 with merge 95fa44657a672ad545fb49d483bfbd0664fbb526...

@TimNN
Copy link
Contributor

TimNN commented Dec 13, 2017

@bors retry

@bors
Copy link
Contributor

bors commented Dec 13, 2017

⌛ Testing commit 35bcd99 with merge 0142781...

bors added a commit that referenced this pull request Dec 13, 2017
Fix visible_parent_map to choose globally minimal paths

Fix #46112: visible_parent_map construction needs a BFS over whole crate forest to get globally minimal paths.

(There are other latent bugs that were e.g. causing this test case to have weirdness like `<unnamed>` in the diagnostic output. Those bugs are not fixed here, since they are issues long-standing in the stable channel.)
@bors
Copy link
Contributor

bors commented Dec 14, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: arielb1
Pushing 0142781 to master...

@bors bors merged commit 35bcd99 into rust-lang:master Dec 14, 2017
pnkfelix added a commit to pnkfelix/rust that referenced this pull request Dec 19, 2017
Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR rust-lang#46708 (which was my original fix to rust-lang#46112).
@pnkfelix pnkfelix mentioned this pull request Dec 19, 2017
@pnkfelix
Copy link
Member Author

(removing beta-nominated tag in favor of #46838 instead, which we think is a much narrower change and thus less risky for beta...)

@pnkfelix pnkfelix removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Dec 19, 2017
pnkfelix added a commit to pnkfelix/rust that referenced this pull request Dec 20, 2017
Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR rust-lang#46708 (which was my original fix to rust-lang#46112).

----

(This is cherry-pick of aa030dd to beta.)
pnkfelix added a commit to pnkfelix/rust that referenced this pull request Dec 21, 2017
…re::`

The reason we see `core::` even after visiting the `std` crate first
is the special case code that looks like this:

```rust
    Entry::Occupied(mut entry) => {
        // If `child` is defined in crate `cnum`, ensure
        // that it is mapped to a parent in `cnum`.
        if child.krate == cnum && entry.get().krate != cnum {
            entry.insert(parent);
        }
    }
```

This causes items to be associated with the crates they were
originally defined in, even if we had encountered them during the
traversal of an earlier crate.

(Having said that, I am not clear on why this same logic does not
apply when both rust-lang#46708 and rust-lang#46838 have been applied. But at this
point, I am just happy to have a plausible explanation for why we see
`core::foo::bar` in the output for these tests, and want to focus on
getting this fix for rust-lang#46112 backported to beta.)
bors added a commit that referenced this pull request Dec 22, 2017
Followup for #46112.

Sorting by crate-num should ensure that we favor `std::foo::bar` over
`any_other_crate::foo::bar`.

Interestingly, *this* change had a much larger impact on our internal
test suite than PR #46708 (which was my original fix to #46112).
bors added a commit that referenced this pull request Dec 23, 2017
…woerister

Backport 46112 fix to beta

Its probably easiest to focus on the diff rather than the commit series.

If you prefer I could squash them, but I figured preserving the cherry-picking will make it easier to relate what has happened here to what happens on the `master` branch.

Note: This is a backport of *just* #46838. It does not include #46708 (which we may end up wanting to revert).

Fix #46112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mismatched type error: type of crate instead of std is displayed
8 participants