-
Notifications
You must be signed in to change notification settings - Fork 13.4k
#[deprecated] fn using format_args!() triggers "use of deprecated item" warning #35128
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
Comments
Hello. What's the real issue here? Are you concerned about the extra error message? Because when I try this in playground, I get two errors and one of them is correct behaviour.
If it's so, I think you should update the title to "Deprecation warning getting incorrectly recursed into builtin macro calls" or something like that. Cheers! |
@cengizio: I believe the current title is pretty accurate:
See: https://is.gd/ua1Lyz |
@TimNN Thanks for clarifying that for me. I traced source to librustc_lint/builtin.rs#L577 but can't seem to find something special for macros. |
Alright, I did some more tests and basically the following happens:
Example: #[deprecated]
fn _foo() {
static FOO: &'static str = "abc";
let _ = FOO; //~ WARN use of deprecated item
} While this specific case is indeed very surprising, the more general case ("deprecated use inside of deprecated item") is already tracked at #16490. |
@TimNN Nice catch! Here's the full expanded version
|
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
This code:
gives this warning:
in current stable and nightly
The text was updated successfully, but these errors were encountered: