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 filters out public items #49178

Closed
mystor opened this issue Mar 19, 2018 · 4 comments
Closed

save-analysis filters out public items #49178

mystor opened this issue Mar 19, 2018 · 4 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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@mystor
Copy link
Contributor

mystor commented Mar 19, 2018

save-analysis currently filters out items based on their span - namely, if the item is determined to be "from a macro" according to its span, it will not be included in the saved analysis.

This can mean that items which are part of a crate's public interface are often filtered out. I imagine we should ensure that we never filter out items which are not #[doc(hidden)] and are part of a crate's public interface.

In addition, a flag should probably be added to the configuration struct to disable generated decl filtering.

@mystor
Copy link
Contributor Author

mystor commented Mar 19, 2018

cc @nrc who I imagine would know the most about this.

@pietroalbini pietroalbini added C-enhancement Category: An issue proposing an enhancement or a PR with one. A-save-analysis Area: saving results of analyses such as inference and borrowck results to a file. labels Mar 21, 2018
@nrc
Copy link
Member

nrc commented Mar 22, 2018

Yeah, macro-generated stuff has caused all kinds of problems in the past. There is a long-term solution which is to handle macro-generated code properly. That means having some representation of the macro-generation in save-analysis and ensuring that all spans are correct (I'm 99% sure that currently there are multiple problems with some spans in the expansion trace).

Short-term it depends what you want the save-analysis info for. For RLS/cargo src/searchfox then there is not much of a solution. We could try and be a bit more lenient about what we filter so that some 'obvious' cases get through and maybe that is enough for you (currently we don't filter all macro-generated code, just most of it. For some cases which we know to not cause problems we could let more stuff through). If you want the data for rustdoc or something similar where you don't span info, then we could be even more lenient and include data for macro-generated code, but without the span info (with some kind of configuration option).

@mystor
Copy link
Contributor Author

mystor commented Mar 22, 2018

Fair, that makes a lot of sense.

The particular use-case which I had for this was more rustdoc-like, so I wanted to be able to see the complete public API of the crate. It might be nice to have this spans-might-be-missing flag, but it might also just make the most sense to wait until the full solution has been implemented.

@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 20, 2020
@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-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants