about summary refs log tree commit diff
path: root/src/test/ui/deprecation/suggestion.fixed
blob: eba72f88a89115cefd1c018221477a124d41d7f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// run-rustfix

#![feature(staged_api)]

#![stable(since = "1.0.0", feature = "test")]

#![deny(deprecated)]
#![allow(dead_code)]

struct Foo;

impl Foo {
    #[rustc_deprecated(
        since = "1.0.0",
        reason = "replaced by `replacement`",
        suggestion = "replacement",
    )]
    #[stable(since = "1.0.0", feature = "test")]
    fn deprecated(&self) {}

    fn replacement(&self) {}
}

fn main() {
    let foo = Foo;

    foo.replacement(); //~ ERROR use of deprecated
}