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

Can we not get attribute from other crate? #12669

Closed
surechen opened this issue Apr 12, 2024 · 2 comments
Closed

Can we not get attribute from other crate? #12669

surechen opened this issue Apr 12, 2024 · 2 comments
Labels
C-question Category: Questions

Comments

@surechen
Copy link
Contributor

surechen commented Apr 12, 2024

Description

As compiler-team are trying to not rely on attributes from extern crates. rust-lang/compiler-team#505

I find clippy are doing this in some function like 'is_hir_ty_cfg_dependant'.

I think we can remove this. Can we do that?

I'm willing to submit a PR to do this.

@flip1995 @xFrednet

Version

No response

Additional Labels

No response

@flip1995 flip1995 added the C-question Category: Questions label Apr 12, 2024
@flip1995
Copy link
Member

flip1995 commented Apr 12, 2024

I'm not sure if I fully understand the ask here. Clippy needs to know if something is cfged for some lints. Otherwise Clippy will introduce a bunch of false positives. I don't know if there are any other external attributes, besides cfg and cfg_attr that we care about.

One thing Clippy does - but I think this is unrelated - is to define attributes like #[clippy::has_significant_drop] which crates like parking_lot use to mark their types. If those types are then used in the crates Clippy is run on, Clippy checks if a type has this attribute. (I think this is similar to what the #[diagnostics] namespace does)

@surechen
Copy link
Contributor Author

I'm not sure if I fully understand the ask here. Clippy needs to know if something is cfged for some lints. Otherwise Clippy will introduce a bunch of false positives. I don't know if there are any other external attributes, besides cfg and cfg_attr that we care about.

One thing Clippy does - but I think this is unrelated - is to define attributes like #[clippy::has_significant_drop] which crates like parking_lot use to mark their types. If those types are then used in the crates Clippy is run on, Clippy checks if a type has this attribute. (I think this is similar to what the #[diagnostics] namespace does)

Very detailed answer. Thank you very much. That is what I want to know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: Questions
Projects
None yet
Development

No branches or pull requests

2 participants