-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Don't warn on use of a deprecated item in a deprecated item #9057
Comments
(Similarly for Should this also consider the case when |
@huonw probably |
I like the idea of: if any parent of yours is unstable, you're allowed to make unstable calls. Equivalently for other stability indices. |
Presumably it's the first parent with a stability annotation that's the stability we should be caring about? So #[deprecated]
mod x {
#[experimental]
mod y {
fn foo() {
experimental(); // ok
deprecated(); // "warning: use of deprecated item"
}
}
} (The stability attributes checking could easily get very slow since it will have to traverse the tree upward and parse the attributes on each parent item for every single function/method call and uses of structs/enums etc etc; it's probably worth using some caches for this information.) |
OK, I'm ok with the closest-parent. I'd also be OK with not re-defining the stability index, or possibly not in some directions. deprecated => experimental doesn't really make sense to me... In theory this can be done in two passes over the ast (with lots of space), one to collect the level of all items and one to process all of them, but that may be overkill. |
Bug triage. This is very similar to the dead_code lint change that we made that considers code marked with |
Triage: this system isn't really considered for external code anymore, so I wonder how important it is. Also, the original code sample does not warn for me today, which seems...odd. |
Updated code:
I agree with my own comment from ten months ago, and this hasn't had any non-triage activity for two years, so I'm just going to give a close. |
For example:
Should not be a warning.
The text was updated successfully, but these errors were encountered: