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

save-analysis: inferred crates are not included #48742

Closed
nrc opened this issue Mar 5, 2018 · 4 comments
Closed

save-analysis: inferred crates are not included #48742

nrc opened this issue Mar 5, 2018 · 4 comments
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.

Comments

@nrc
Copy link
Member

nrc commented Mar 5, 2018

save-analysis includes crates declared with extern crate or in the implicit prelude, but does not include those inferred from imports due to the new extern crate elision feature. I assume because extern_crate on the tcx does not include info for those crates (see https://github.com/rust-lang/rust/blob/master/src/librustc_save_analysis/lib.rs#L113).

This is the root cause for part of rust-lang/rls#729

@nrc nrc added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. A-rls labels Mar 5, 2018
@nrc
Copy link
Member Author

nrc commented Mar 5, 2018

cc @petrochenkov who implemented the 'implicit extern crate' support in #47156

I can't see where the info about extern crates gets into the tcx, but if it is syntactic then perhaps this is just a bug of omission where #47156 should also have entered info about implicit extern crates into the tcx too?

@petrochenkov petrochenkov self-assigned this Mar 5, 2018
@TimNN TimNN added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Mar 6, 2018
@nrc nrc removed the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Mar 14, 2018
@nrc
Copy link
Member Author

nrc commented Mar 16, 2018

ping @petrochenkov @rust-lang/compiler - anyone got advice on how to address this issue?

@sinkuu
Copy link
Contributor

sinkuu commented Apr 10, 2018

master...sinkuu:save_analysis_implicit_extern
I'd like to make a PR unless @petrochenkov has already been working on this.

@petrochenkov
Copy link
Contributor

@sinkuu
Thanks for fixing this issue, I never got to it.

@petrochenkov petrochenkov removed their assignment Apr 10, 2018
bors added a commit that referenced this issue Apr 16, 2018
…henkov

Fix save-analysis generation with extern_in_paths/extern_absolute_paths

Fixes #48742.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants