-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
deprecated lint should not warn within a deprecated module #16490
Comments
cc @sfackler |
To reproduce:
this will give both
It's been a year, with no discussion at all. I'm not sure this is worth doing. |
This just came up again in #35128, although a little bit more surprisingly, due to the expansion of @steveklabnik: If I understand the original issue correctly, I believe your code should continue to warn about the I believe the issue is that the following warning should not happen: #[deprecated]
mod nope {
fn foo() {}
fn bar() {
foo() //~ WARN use of deprecated item
}
} |
The fix doesn't seem that hard. |
If nobody has picked this up by then, I'll see if I can come up with a fix for this towards the end of the week. |
Whenever a node whould be reported as deprecated: - check if the parent item is also deprecated - if it is and both were deprecated by the same attribute - skip the deprecation warning fixes rust-lang#35128 closes rust-lang#16490
Whenever a node whould be reported as deprecated: - check if the parent item is also deprecated - if it is and both were deprecated by the same attribute - skip the deprecation warning fixes rust-lang#35128 closes rust-lang#16490
The stability lint was recently changed to warn on use of deprecated items even when they are defined in the same crate. An unintended consequence is that, when an entire module is deprecated, the body of the module will warn on every use of items defined within it.
We should change this behavior, but it's not entirely clear what the rule should be or how to implement it.
The text was updated successfully, but these errors were encountered: