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

Globs in save-analysis do not contain exports in value #49910

Closed
euclio opened this issue Apr 12, 2018 · 3 comments
Closed

Globs in save-analysis do not contain exports in value #49910

euclio opened this issue Apr 12, 2018 · 3 comments
Labels
A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-lang Relevant to the language team, which will review and decide on the PR/issue.

Comments

@euclio
Copy link
Contributor

euclio commented Apr 12, 2018

Uncovered by rust-dev-tools/rls-analysis#124.

For the following code:

pub use private::*;

mod private {
    pub struct Struct1;
    pub struct Struct2;
}
$ RUST_SAVE_ANALYSIS_CONFIG='{ "reachable_only": true, "full_docs": true, "pub_only": false, "distro_crate": false, "signatures": false, "borrow_data": false }' rustc -Zsave-analysis test.rs

The save analysis data for the glob use has an empty string for the value, when I would expect Struct1 and Struct2 would be in the string.

The theory is that the glob_map created by the librustc_resolve::Resolver only contains imports actually used inside the module, but the save analysis data wants to include exports as well. The glob_map is used to create the value field in the analysis here.

I'm happy to work and submit a PR for this, but I don't think that I understand enough about the resolve code to move forward, particularly around what causes an import to be considered "used". Could someone give me some help?

@euclio
Copy link
Contributor Author

euclio commented Apr 16, 2018

cc @nrc

@nrc
Copy link
Member

nrc commented Apr 18, 2018

@jseyfried would you be able to provide some help here please?

@XAMPPRocky XAMPPRocky added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-lang Relevant to the language team, 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. labels Jul 7, 2018
@jyn514
Copy link
Member

jyn514 commented Feb 19, 2023

Save-analysis has been removed from the compiler.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 19, 2023
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. C-enhancement Category: An issue proposing an enhancement or a PR with one. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants