2019-03-24 01:13:57 +00:00
|
|
|
//@ run-rustfix
|
|
|
|
|
|
|
|
#![feature(staged_api)]
|
2022-02-16 23:48:33 +00:00
|
|
|
#![feature(deprecated_suggestion)]
|
2021-06-04 19:26:36 +00:00
|
|
|
|
2019-03-24 01:13:57 +00:00
|
|
|
#![stable(since = "1.0.0", feature = "test")]
|
2021-06-04 19:26:36 +00:00
|
|
|
|
2019-03-24 01:13:57 +00:00
|
|
|
#![deny(deprecated)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl Foo {
|
2022-03-05 02:59:18 +00:00
|
|
|
#[deprecated(
|
2019-03-24 01:13:57 +00:00
|
|
|
since = "1.0.0",
|
2022-03-05 02:59:18 +00:00
|
|
|
note = "replaced by `replacement`",
|
2019-03-24 01:13:57 +00:00
|
|
|
suggestion = "replacement",
|
|
|
|
)]
|
|
|
|
#[stable(since = "1.0.0", feature = "test")]
|
|
|
|
fn deprecated(&self) {}
|
|
|
|
|
|
|
|
fn replacement(&self) {}
|
|
|
|
}
|
|
|
|
|
2021-06-15 08:21:58 +00:00
|
|
|
mod bar {
|
2022-03-05 02:59:18 +00:00
|
|
|
#[deprecated(
|
2021-06-15 08:21:58 +00:00
|
|
|
since = "1.0.0",
|
2022-03-05 02:59:18 +00:00
|
|
|
note = "replaced by `replacement`",
|
2021-06-15 08:21:58 +00:00
|
|
|
suggestion = "replacement",
|
|
|
|
)]
|
|
|
|
#[stable(since = "1.0.0", feature = "test")]
|
|
|
|
pub fn deprecated() {}
|
|
|
|
|
|
|
|
pub fn replacement() {}
|
|
|
|
}
|
|
|
|
|
2019-03-24 01:13:57 +00:00
|
|
|
fn main() {
|
|
|
|
let foo = Foo;
|
2021-05-24 03:41:39 +00:00
|
|
|
|
2021-06-04 19:26:36 +00:00
|
|
|
foo.deprecated(); //~ ERROR use of deprecated
|
2021-06-15 08:21:58 +00:00
|
|
|
|
|
|
|
bar::deprecated(); //~ ERROR use of deprecated
|
2019-03-24 01:13:57 +00:00
|
|
|
}
|