]> git.lizzy.rs Git - rust.git/blob - src/test/ui/feature-gates/issue-43106-gating-of-rustc_deprecated.rs
Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_clif-2021-02-01
[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
10 #[rustc_deprecated()]
11 //~^ ERROR stability attributes may not be used outside of the standard library
12 mod rustc_deprecated {
13     mod inner { #![rustc_deprecated()] }
14     //~^ ERROR stability attributes may not be used outside of the standard library
15
16     #[rustc_deprecated()] fn f() { }
17     //~^ ERROR stability attributes may not be used outside of the standard library
18
19     #[rustc_deprecated()] struct S;
20     //~^ ERROR stability attributes may not be used outside of the standard library
21     //~| ERROR stability attributes may not be used outside of the standard library
22
23     #[rustc_deprecated()] type T = S;
24     //~^ ERROR stability attributes may not be used outside of the standard library
25
26     #[rustc_deprecated()] impl S { }
27     //~^ ERROR stability attributes may not be used outside of the standard library
28 }
29
30 fn main() {}