Skip to content

diagnostics: make paths to external items more visible - #32439

Merged
alexcrichton merged 2 commits into
rust-lang:masterfrom
jseyfried:visible_suggestions
Mar 31, 2016
Merged

diagnostics: make paths to external items more visible#32439
alexcrichton merged 2 commits into
rust-lang:masterfrom
jseyfried:visible_suggestions

Conversation

@jseyfried

Copy link
Copy Markdown
Contributor

This PR changes the reported path for an external item so that it is visible from at least one local module (i.e. it does not use any inaccessible external modules) if possible. If the external item's crate was declared with an extern crate, the path is guarenteed to use the extern crate.

Fixes#23224, fixes#23355, fixes#26635, fixes#27165.

r? @nrc

@alexcrichton

Copy link
Copy Markdown
Member

Holy cow I thought I'd never live to see the day this got implemented.

Thank you @jseyfried!

🍰

@jseyfried
jseyfriedforce-pushed the visible_suggestions branch 2 times, most recently from 6dfa268 to 4f87af1CompareMarch 23, 2016 06:44
@mitaa

Copy link
Copy Markdown
Contributor

Nice!

FYI, with #32293 there is also a refactoring going on here which lands soon. (8500e5b, ...)

Comment threadsrc/librustc_metadata/cstore.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the RefMut?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RefCell has to be borrowed mutably in this function and I didn't want to needlessly re-borrow it immutably before returning. This function is only used in librustc_metadata so I don't think it makes much difference.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you document this function please?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

Comment threadsrc/librustc_metadata/cstore.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: spread over 3 lines

@nrc

nrc commented Mar 24, 2016

Copy link
Copy Markdown
Member

r+ with the nits addressed

@jseyfried
jseyfriedforce-pushed the visible_suggestions branch 3 times, most recently from ccc40dc to 17e8ce8CompareMarch 25, 2016 06:53
@jseyfried

Copy link
Copy Markdown
ContributorAuthor

@nrc thanks for the feedback! I addressed your comments in the most recent commit.

We should probably wait for #32293 to land before merging this since there will be non-trivial conflicts (cc @nikomatsakis).

@bors

bors commented Mar 26, 2016

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (presumably #32293) made this pull request unmergeable. Please resolve the merge conflicts.

@jseyfried
jseyfriedforce-pushed the visible_suggestions branch 6 times, most recently from e43422e to 6ac1799CompareMarch 29, 2016 06:55
@eddyb

Copy link
Copy Markdown
Contributor

@jseyfried I think this can be r=nrc with src/test/pretty/issue-4264.pp updated to use the new paths (see travis failure).

@jseyfried
jseyfriedforce-pushed the visible_suggestions branch 3 times, most recently from 8183ec4 to d5ea770CompareMarch 30, 2016 01:05
@jseyfried

Copy link
Copy Markdown
ContributorAuthor

@bors r=nrc

@bors

bors commented Mar 30, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit da41e58 has been approved by nrc

@bors

bors commented Mar 31, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit da41e58 with merge 4583dc9...

bors added a commit that referenced this pull request Mar 31, 2016
diagnostics: make paths to external items more visible
This PR changes the reported path for an external item so that it is visible from at least one local module (i.e. it does not use any inaccessible external modules) if possible. If the external item's crate was declared with an `extern crate`, the path is guarenteed to use the `extern crate`.
Fixes#23224, fixes#23355, fixes#26635, fixes#27165.
r? @nrc
@bors

bors commented Mar 31, 2016

Copy link
Copy Markdown
Collaborator

💥 Test timed out

@eddyb

Copy link
Copy Markdown
Contributor

@bors force retry

@eddyb

Copy link
Copy Markdown
Contributor

@bors p=1

@alexcrichton

Copy link
Copy Markdown
Member

This ended up passing all tests on bors, not sure what happened here so I'm just gonna merge manually

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

7 participants

@jseyfried@alexcrichton@mitaa@nrc@bors@eddyb@arielb1