]> git.lizzy.rs Git - rust.git/blob - src/test/ui/deprecation/suggestion.fixed
Rollup merge of #85717 - fee1-dead:document-cow, r=yaahc
[rust.git] / src / test / ui / deprecation / suggestion.fixed
1 // run-rustfix
2
3 #![feature(staged_api)]
4 #![stable(since = "1.0.0", feature = "test")]
5 #![deny(deprecated)]
6 #![allow(dead_code)]
7
8 struct Foo;
9
10 impl Foo {
11     #[rustc_deprecated(
12         since = "1.0.0",
13         reason = "replaced by `replacement`",
14         suggestion = "replacement",
15     )]
16     #[stable(since = "1.0.0", feature = "test")]
17     fn deprecated(&self) {}
18
19     fn replacement(&self) {}
20 }
21
22 mod bar {
23     #[rustc_deprecated(
24     since = "1.0.0",
25     reason = "replaced by `replacement`",
26     suggestion = "replacement",
27     )]
28     #[stable(since = "1.0.0", feature = "test")]
29     pub fn deprecated() {}
30
31     pub fn replacement() {}
32 }
33
34 fn main() {
35     let foo = Foo;
36     foo.replacement(); //~ ERROR use of deprecated
37
38     bar::replacement(); //~ ERROR use of deprecated
39 }