fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
804 B43 linesraw
1// run-rustfix
2
3#![feature(staged_api)]
4#![feature(deprecated_suggestion)]
5
6#![stable(since = "1.0.0", feature = "test")]
7
8#![deny(deprecated)]
9#![allow(dead_code)]
10
11struct Foo;
12
13impl Foo {
14    #[deprecated(
15        since = "1.0.0",
16        note = "replaced by `replacement`",
17        suggestion = "replacement",
18    )]
19    #[stable(since = "1.0.0", feature = "test")]
20    fn deprecated(&self) {}
21
22    fn replacement(&self) {}
23}
24
25mod bar {
26    #[deprecated(
27    since = "1.0.0",
28    note = "replaced by `replacement`",
29    suggestion = "replacement",
30    )]
31    #[stable(since = "1.0.0", feature = "test")]
32    pub fn deprecated() {}
33
34    pub fn replacement() {}
35}
36
37fn main() {
38    let foo = Foo;
39
40    foo.replacement(); //~ ERROR use of deprecated
41
42    bar::replacement(); //~ ERROR use of deprecated
43}