]> git.lizzy.rs Git - rust.git/blob - src/test/auxiliary/lint_stability.rs
Auto merge of #22517 - brson:relnotes, r=Gankro
[rust.git] / src / test / auxiliary / lint_stability.rs
1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10 #![crate_name="lint_stability"]
11 #![crate_type = "lib"]
12 #![feature(staged_api)]
13 #![staged_api]
14 #![stable(feature = "lint_stability", since = "1.0.0")]
15
16 #[stable(feature = "test_feature", since = "1.0.0")]
17 #[deprecated(since = "1.0.0")]
18 pub fn deprecated() {}
19 #[stable(feature = "test_feature", since = "1.0.0")]
20 #[deprecated(since = "1.0.0", reason = "text")]
21 pub fn deprecated_text() {}
22
23 #[unstable(feature = "test_feature")]
24 #[deprecated(since = "1.0.0")]
25 pub fn deprecated_unstable() {}
26 #[unstable(feature = "test_feature")]
27 #[deprecated(since = "1.0.0", reason = "text")]
28 pub fn deprecated_unstable_text() {}
29
30 #[unstable(feature = "test_feature")]
31 pub fn unstable() {}
32 #[unstable(feature = "test_feature", reason = "text")]
33 pub fn unstable_text() {}
34
35 #[stable(feature = "rust1", since = "1.0.0")]
36 pub fn stable() {}
37 #[stable(feature = "rust1", since = "1.0.0", reason = "text")]
38 pub fn stable_text() {}
39
40 #[stable(feature = "rust1", since = "1.0.0")]
41 pub struct MethodTester;
42
43 impl MethodTester {
44     #[stable(feature = "test_feature", since = "1.0.0")]
45     #[deprecated(since = "1.0.0")]
46     pub fn method_deprecated(&self) {}
47     #[stable(feature = "test_feature", since = "1.0.0")]
48     #[deprecated(since = "1.0.0", reason = "text")]
49     pub fn method_deprecated_text(&self) {}
50
51     #[unstable(feature = "test_feature")]
52     #[deprecated(since = "1.0.0")]
53     pub fn method_deprecated_unstable(&self) {}
54     #[unstable(feature = "test_feature")]
55     #[deprecated(since = "1.0.0", reason = "text")]
56     pub fn method_deprecated_unstable_text(&self) {}
57
58     #[unstable(feature = "test_feature")]
59     pub fn method_unstable(&self) {}
60     #[unstable(feature = "test_feature", reason = "text")]
61     pub fn method_unstable_text(&self) {}
62
63     #[stable(feature = "rust1", since = "1.0.0")]
64     pub fn method_stable(&self) {}
65     #[stable(feature = "rust1", since = "1.0.0", reason = "text")]
66     pub fn method_stable_text(&self) {}
67 }
68
69 #[stable(feature = "test_feature", since = "1.0.0")]
70 pub trait Trait {
71     #[stable(feature = "test_feature", since = "1.0.0")]
72     #[deprecated(since = "1.0.0")]
73     fn trait_deprecated(&self) {}
74     #[stable(feature = "test_feature", since = "1.0.0")]
75     #[deprecated(since = "1.0.0", reason = "text")]
76     fn trait_deprecated_text(&self) {}
77
78     #[unstable(feature = "test_feature")]
79     #[deprecated(since = "1.0.0")]
80     fn trait_deprecated_unstable(&self) {}
81     #[unstable(feature = "test_feature")]
82     #[deprecated(since = "1.0.0", reason = "text")]
83     fn trait_deprecated_unstable_text(&self) {}
84
85     #[unstable(feature = "test_feature")]
86     fn trait_unstable(&self) {}
87     #[unstable(feature = "test_feature", reason = "text")]
88     fn trait_unstable_text(&self) {}
89
90     #[stable(feature = "rust1", since = "1.0.0")]
91     fn trait_stable(&self) {}
92     #[stable(feature = "rust1", since = "1.0.0", reason = "text")]
93     fn trait_stable_text(&self) {}
94 }
95
96 impl Trait for MethodTester {}
97
98 #[unstable(feature = "test_feature")]
99 pub trait UnstableTrait {}
100
101 #[stable(feature = "test_feature", since = "1.0.0")]
102 #[deprecated(since = "1.0.0")]
103 pub struct DeprecatedStruct { pub i: int }
104 #[unstable(feature = "test_feature")]
105 #[deprecated(since = "1.0.0")]
106 pub struct DeprecatedUnstableStruct { pub i: int }
107 #[unstable(feature = "test_feature")]
108 pub struct UnstableStruct { pub i: int }
109 #[stable(feature = "rust1", since = "1.0.0")]
110 pub struct StableStruct { pub i: int }
111
112 #[stable(feature = "test_feature", since = "1.0.0")]
113 #[deprecated(since = "1.0.0")]
114 pub struct DeprecatedUnitStruct;
115 #[unstable(feature = "test_feature")]
116 #[deprecated(since = "1.0.0")]
117 pub struct DeprecatedUnstableUnitStruct;
118 #[unstable(feature = "test_feature")]
119 pub struct UnstableUnitStruct;
120 #[stable(feature = "rust1", since = "1.0.0")]
121 pub struct StableUnitStruct;
122
123 #[stable(feature = "test_feature", since = "1.0.0")]
124 pub enum Enum {
125     #[stable(feature = "test_feature", since = "1.0.0")]
126     #[deprecated(since = "1.0.0")]
127     DeprecatedVariant,
128     #[unstable(feature = "test_feature")]
129     #[deprecated(since = "1.0.0")]
130     DeprecatedUnstableVariant,
131     #[unstable(feature = "test_feature")]
132     UnstableVariant,
133
134     #[stable(feature = "rust1", since = "1.0.0")]
135     StableVariant,
136 }
137
138 #[stable(feature = "test_feature", since = "1.0.0")]
139 #[deprecated(since = "1.0.0")]
140 pub struct DeprecatedTupleStruct(pub int);
141 #[unstable(feature = "test_feature")]
142 #[deprecated(since = "1.0.0")]
143 pub struct DeprecatedUnstableTupleStruct(pub int);
144 #[unstable(feature = "test_feature")]
145 pub struct UnstableTupleStruct(pub int);
146 #[stable(feature = "rust1", since = "1.0.0")]
147 pub struct StableTupleStruct(pub int);
148
149 #[macro_export]
150 macro_rules! macro_test {
151     () => (deprecated());
152 }
153
154 #[macro_export]
155 macro_rules! macro_test_arg {
156     ($func:expr) => ($func);
157 }
158
159 #[macro_export]
160 macro_rules! macro_test_arg_nested {
161     ($func:ident) => (macro_test_arg!($func()));
162 }