-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Closed as not planned
Labels
A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.Area: saving results of analyses such as inference and borrowck results to a file.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-langRelevant to the language teamRelevant to the language team
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-save-analysisArea: saving results of analyses such as inference and borrowck results to a file.Area: saving results of analyses such as inference and borrowck results to a file.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-langRelevant to the language teamRelevant to the language team