]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.rs
Rollup merge of #94593 - estebank:issue-94510, r=davidtwco
[rust.git] / src / test / ui / feature-gates / issue-43106-gating-of-rustc_deprecated.rs
1 // Testing gating of `#[rustc_deprecated]` in "weird" places.
2 //
3 // This file sits on its own because these signal errors, making
4 // this test incompatible with the "warnings only" nature of
5 // issue-43106-gating-of-builtin-attrs.rs
6
7 #![rustc_deprecated()]
8 //~^ ERROR stability attributes may not be used outside of the standard library
9 //~| ERROR missing 'since' [E0542]
10
11 #[rustc_deprecated()]
12 //~^ ERROR stability attributes may not be used outside of the standard library
13 //~| ERROR missing 'since' [E0542]
14 mod rustc_deprecated {
15     mod inner {
16         #![rustc_deprecated()]
17         //~^ ERROR stability attributes may not be used outside of the standard library
18         //~| ERROR missing 'since' [E0542]
19     }
20
21     #[rustc_deprecated()]
22     //~^ ERROR stability attributes may not be used outside of the standard library
23     //~| ERROR missing 'since' [E0542]
24     fn f() {}
25
26     #[rustc_deprecated()]
27     //~^ ERROR stability attributes may not be used outside of the standard library
28     //~| ERROR missing 'since' [E0542]
29     //~| ERROR missing 'since' [E0542]
30     struct S;
31
32     #[rustc_deprecated()]
33     //~^ ERROR stability attributes may not be used outside of the standard library
34     //~| ERROR missing 'since' [E0542]
35     type T = S;
36
37     #[rustc_deprecated()]
38     //~^ ERROR stability attributes may not be used outside of the standard library
39     //~| ERROR missing 'since' [E0542]
40     impl S {}
41 }
42
43 fn main() {}