Closed
Description
When since
> version of rustc
and patch is in the version then deprecated is ignored:
My expectation is that: since
is referring to the version of my crate, not the rustc version.
struct Bar {}
impl Bar {
#[deprecated(since = "1.32.0")]
fn patch_works(&self) -> () { () }
#[deprecated(since = "1.33.0")]
fn patch_ignored1(&self) -> () { () }
#[deprecated(since = "2.1.0")]
fn patch_ignored2(&self) -> () { () }
#[deprecated(since = "2.0")]
fn minor_works(&self) -> () { () }
}
fn main() {
let bar = Bar { };
bar.patch_works();
bar.patch_ignored1();
bar.patch_ignored2();
bar.minor_works();
}
The docs say:
since expects a version number, as in #[deprecated(since = "1.4.1")]
rustc doesn't know anything about versions, but external tools like clippy may check the validity of this field.