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

Hide deprecation warnings inside derive expansions #419

Open
aborgna-q opened this issue Oct 21, 2024 · 0 comments
Open

Hide deprecation warnings inside derive expansions #419

aborgna-q opened this issue Oct 21, 2024 · 0 comments

Comments

@aborgna-q
Copy link

aborgna-q commented Oct 21, 2024

Consider the following example:

use derive_more::Display;
#[derive(Debug, Display)]
pub enum Test {
    #[deprecated(note = "this is deprecated")]
    B { x: usize },
}

Compiling this produces a warning:

warning: use of deprecated field `derive_more_deprecate::Test::B::x`: this is deprecated
 --> src/derive_more_deprecate.rs:5:9
  |
5 |     B { x: usize },
  |         ^

Adding #[allow(deprecated)] does not help since the attribute does not get added to the impl Display.

This also happens with other derive macros (From, Error, ...).

@aborgna-q aborgna-q changed the title Hide deprecation warnings inside Display derive expansion Hide deprecation warnings inside derive expansions Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant