Closed
Description
Let's consider the following situation: there is a enumeration in which have an deprecated element. This enumeration derives implementation of some traits. In such case rustc generates deprecation warning, but actually deprecated item never used.
As in this case there is no control over the generated code, I consider that the warning shouldn't be. It is impossible to suppress warning also because the element is marked deprecated for the reason that he shouldn't be used obviously. If to suppress him, then meaning to mark a enumaration element as deprecated is lost.
Example of problem:
#![allow(dead_code)]
#[derive(Debug)]
enum Example {
Var1,
#[deprecated]
Var2,
}
fn main() {
}
Output:
rustc 1.14.0 (e8a012324 2016-12-16)
warning: use of deprecated item, #[warn(deprecated)] on by default
--> <anon>:6:5
|
6 | Var2,
| ^^^^