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

Move unused-attribute pass after trans #14406

Closed
sfackler opened this issue May 24, 2014 · 4 comments
Closed

Move unused-attribute pass after trans #14406

sfackler opened this issue May 24, 2014 · 4 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.

Comments

@sfackler
Copy link
Member

Many attributes are not used until after trans, but the current lint pass runs before it. Those attributes are currently globally whitelisted, but this isn't a great long term solution.

@emberian
Copy link
Member

@sfackler this would require keeping the AST and all analysis data through trans, right?

@sfackler
Copy link
Member Author

That or performing the check as trans consumes the AST.

@jonas-schievink
Copy link
Contributor

Looks like this could cause issues with -Zno-trans

@Mark-Simulacrum
Copy link
Member

I suspect that this is superseded by #17642. If you'd like to reopen with a specific set of attributes that should be handled, then we can do so (for example, #[used] is now special-cased: #41637).

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
…, r=Veykril

Add doc-alias based completion

Closes rust-lang#14406.

I adapted the parsing code from the CfgExpr parsing code, maybe there's a better abstraction for both, or attribute parsing in general. It also includes `doc(hidden)`-parsing, which means it could replace the other function.
There are a few tests for parsing.

`process_all_names` changed the most, I added some docs there to explain what happens.

Many call sites just pass an empy vec to `add_path_resolution`'s `doc_aliases`, since either it doesn't make sense to pass anything (e.g. visibility completion) or I don't know where to get them from. Shouldn't really matter, as it will just not show aliases if the vec is empty and we can extend alias completion in these cases later.

I added two tests in `special.rs` for struct name completion (which was the main thing I wanted). I also tried function and field names, but these don't work yet. I want to add those in a follow-up PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut.
Projects
None yet
Development

No branches or pull requests

4 participants