Open
Description
When using the #[automatically_derived]
attribute on deprecated items, deprecation warnings are not omitted for that item. This does not affect macros from the stdlib.
The following code will not compile under these conditions:
#![deny(deprecated)]
#[deprecated]
struct DeprecatedItem;
trait MyTrait {}
// Imagine this block was derived.
#[automatically_derived]
impl MyTrait for DeprecatedItem {}
It would be possible to use #[allow(deprecated)]
on the derived impl
block to omit the warnings, but that affects the entire block instead of only DeprecatedItem
. This will also not work if the #![forbid(deprecated)]
lint is enabled.
I expected to see this happen: The code should compile despite and ignore the use of DeprecatedItem
when within the [#automatically_derived]
attribute.
Instead, this happened: The code does not compile.
Meta
rustc --version --verbose
:
rustc 1.70.0-nightly (84dd17b56 2023-04-14)
binary: rustc
commit-hash: 84dd17b56a931a631a23dfd5ef2018fd3ef49108
commit-date: 2023-04-14
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 16.0.2