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

Add a pass to mark doc attributes as used #14408

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

Add a pass to mark doc attributes as used #14408

sfackler opened this issue May 24, 2014 · 6 comments
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@sfackler
Copy link
Member

sfackler commented May 24, 2014

The unused-attribute lint currently globally whitelists all doc attributes as used, even if they're placed in contexts that rustdoc would never look at (e.g. match arms). There should be a separate pass over the AST that marks the attributes in the correct contexts.

#![warn(unused_attributes)]

fn f() {
    match 10 {
        /// test
        _ => {}
    }
}
@steveklabnik
Copy link
Member

Triage: no change that I'm aware of.

@steveklabnik
Copy link
Member

Triage: same as last year

@Havvy
Copy link
Contributor

Havvy commented Jun 30, 2018

Triage: There's a new lint unused_doc_comments that triggers in these cases. IMO, this is good enough to close the issue as fixed. cc @QuietMisdreavus for confirmation.

@QuietMisdreavus
Copy link
Member

@Havvy When/where was this lint added? I'm not familiar with it.

@euclio
Copy link
Contributor

euclio commented Nov 28, 2018

Added in #43009, where this case is specifically tested.

@Mark-Simulacrum
Copy link
Member

Closing as per the above, looks like this was implemented in the unused_doc_comments lint.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
internal: Only intern blocks that declare items

We only used `BlockId` for the block defmap, so this is wasted memory. Lowering for non item declaring blocks is also cheaper now as we no longer have to fully lower a block that defines not items.
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. C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

6 participants