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

Derives on deprecated enum variants generate deprecation warnings #92313

Open
Gerhut opened this issue Dec 27, 2021 · 1 comment
Open

Derives on deprecated enum variants generate deprecation warnings #92313

Gerhut opened this issue Dec 27, 2021 · 1 comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Gerhut
Copy link

Gerhut commented Dec 27, 2021

I tried this code:

use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize)]
enum Point {
    #[deprecated]
    TwoD(i32, i32),
    ThreeD(i32, i32, i32),
}

fn main() {
    println!("Hello, world!");
}

I expected to see this happen: explanation

No deprecated warnings generated.

Instead, this happened: explanation

use of deprecated tuple variant Point::TwoD
#[warn(deprecated)] on by default

Meta

rustc --version --verbose:

rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-unknown-linux-gnu
release: 1.57.0
LLVM version: 13.0.0
@Gerhut Gerhut added the C-bug Category: This is a bug. label Dec 27, 2021
@Gerhut
Copy link
Author

Gerhut commented Dec 27, 2021

Seems same issue with struct field was fixed in #58994

@fmease fmease added A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. and removed needs-triage-legacy labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: Lints (warnings about flaws in source code) such as unused_mut. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants