]> git.proxmox.com Git - rustc.git/blob - src/test/ui/stability-attribute/auxiliary/lint-stability.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / stability-attribute / auxiliary / lint-stability.rs
1 #![crate_name="lint_stability"]
2 #![crate_type = "lib"]
3 #![feature(staged_api)]
4 #![feature(associated_type_defaults)]
5 #![stable(feature = "lint_stability", since = "1.0.0")]
6
7 #[stable(feature = "stable_test_feature", since = "1.0.0")]
8 #[deprecated(since = "1.0.0", note = "text")]
9 pub fn deprecated() {}
10 #[stable(feature = "stable_test_feature", since = "1.0.0")]
11 #[deprecated(since = "1.0.0", note = "text")]
12 pub fn deprecated_text() {}
13
14 #[stable(feature = "stable_test_feature", since = "1.0.0")]
15 #[deprecated(since = "99.99.99", note = "text")]
16 pub fn deprecated_future() {}
17
18 #[unstable(feature = "unstable_test_feature", issue = "none")]
19 #[deprecated(since = "1.0.0", note = "text")]
20 pub fn deprecated_unstable() {}
21 #[unstable(feature = "unstable_test_feature", issue = "none")]
22 #[deprecated(since = "1.0.0", note = "text")]
23 pub fn deprecated_unstable_text() {}
24
25 #[unstable(feature = "unstable_test_feature", issue = "none")]
26 pub fn unstable() {}
27 #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
28 pub fn unstable_text() {}
29
30 #[stable(feature = "rust1", since = "1.0.0")]
31 pub fn stable() {}
32 #[stable(feature = "rust1", since = "1.0.0")]
33 pub fn stable_text() {}
34
35 #[stable(feature = "rust1", since = "1.0.0")]
36 pub struct MethodTester;
37
38 impl MethodTester {
39 #[stable(feature = "stable_test_feature", since = "1.0.0")]
40 #[deprecated(since = "1.0.0", note = "text")]
41 pub fn method_deprecated(&self) {}
42 #[stable(feature = "stable_test_feature", since = "1.0.0")]
43 #[deprecated(since = "1.0.0", note = "text")]
44 pub fn method_deprecated_text(&self) {}
45
46 #[unstable(feature = "unstable_test_feature", issue = "none")]
47 #[deprecated(since = "1.0.0", note = "text")]
48 pub fn method_deprecated_unstable(&self) {}
49 #[unstable(feature = "unstable_test_feature", issue = "none")]
50 #[deprecated(since = "1.0.0", note = "text")]
51 pub fn method_deprecated_unstable_text(&self) {}
52
53 #[unstable(feature = "unstable_test_feature", issue = "none")]
54 pub fn method_unstable(&self) {}
55 #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
56 pub fn method_unstable_text(&self) {}
57
58 #[stable(feature = "rust1", since = "1.0.0")]
59 pub fn method_stable(&self) {}
60 #[stable(feature = "rust1", since = "1.0.0")]
61 pub fn method_stable_text(&self) {}
62 }
63
64 #[stable(feature = "stable_test_feature", since = "1.0.0")]
65 pub trait Trait {
66 #[stable(feature = "stable_test_feature", since = "1.0.0")]
67 #[deprecated(since = "1.0.0", note = "text")]
68 fn trait_deprecated(&self) {}
69 #[stable(feature = "stable_test_feature", since = "1.0.0")]
70 #[deprecated(since = "1.0.0", note = "text")]
71 fn trait_deprecated_text(&self) {}
72
73 #[unstable(feature = "unstable_test_feature", issue = "none")]
74 #[deprecated(since = "1.0.0", note = "text")]
75 fn trait_deprecated_unstable(&self) {}
76 #[unstable(feature = "unstable_test_feature", issue = "none")]
77 #[deprecated(since = "1.0.0", note = "text")]
78 fn trait_deprecated_unstable_text(&self) {}
79
80 #[unstable(feature = "unstable_test_feature", issue = "none")]
81 fn trait_unstable(&self) {}
82 #[unstable(feature = "unstable_test_feature", reason = "text", issue = "none")]
83 fn trait_unstable_text(&self) {}
84
85 #[stable(feature = "rust1", since = "1.0.0")]
86 fn trait_stable(&self) {}
87 #[stable(feature = "rust1", since = "1.0.0")]
88 fn trait_stable_text(&self) {}
89 }
90
91 #[stable(feature = "stable_test_feature", since = "1.0.0")]
92 pub trait TraitWithAssociatedTypes {
93 #[unstable(feature = "unstable_test_feature", issue = "none")]
94 type TypeUnstable = u8;
95 #[stable(feature = "stable_test_feature", since = "1.0.0")]
96 #[deprecated(since = "1.0.0", note = "text")]
97 type TypeDeprecated = u8;
98 }
99
100 #[stable(feature = "stable_test_feature", since = "1.0.0")]
101 impl Trait for MethodTester {}
102
103 #[unstable(feature = "unstable_test_feature", issue = "none")]
104 pub trait UnstableTrait { fn dummy(&self) { } }
105
106 #[stable(feature = "stable_test_feature", since = "1.0.0")]
107 #[deprecated(since = "1.0.0", note = "text")]
108 pub trait DeprecatedTrait {
109 #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
110 }
111
112 #[stable(feature = "stable_test_feature", since = "1.0.0")]
113 #[deprecated(since = "1.0.0", note = "text")]
114 pub struct DeprecatedStruct {
115 #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
116 }
117 #[unstable(feature = "unstable_test_feature", issue = "none")]
118 #[deprecated(since = "1.0.0", note = "text")]
119 pub struct DeprecatedUnstableStruct {
120 #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
121 }
122 #[unstable(feature = "unstable_test_feature", issue = "none")]
123 pub struct UnstableStruct {
124 #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
125 }
126 #[stable(feature = "rust1", since = "1.0.0")]
127 pub struct StableStruct {
128 #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
129 }
130 #[unstable(feature = "unstable_test_feature", issue = "none")]
131 pub enum UnstableEnum {}
132 #[stable(feature = "rust1", since = "1.0.0")]
133 pub enum StableEnum {}
134
135 #[stable(feature = "stable_test_feature", since = "1.0.0")]
136 #[deprecated(since = "1.0.0", note = "text")]
137 pub struct DeprecatedUnitStruct;
138 #[unstable(feature = "unstable_test_feature", issue = "none")]
139 #[deprecated(since = "1.0.0", note = "text")]
140 pub struct DeprecatedUnstableUnitStruct;
141 #[unstable(feature = "unstable_test_feature", issue = "none")]
142 pub struct UnstableUnitStruct;
143 #[stable(feature = "rust1", since = "1.0.0")]
144 pub struct StableUnitStruct;
145
146 #[stable(feature = "stable_test_feature", since = "1.0.0")]
147 pub enum Enum {
148 #[stable(feature = "stable_test_feature", since = "1.0.0")]
149 #[deprecated(since = "1.0.0", note = "text")]
150 DeprecatedVariant,
151 #[unstable(feature = "unstable_test_feature", issue = "none")]
152 #[deprecated(since = "1.0.0", note = "text")]
153 DeprecatedUnstableVariant,
154 #[unstable(feature = "unstable_test_feature", issue = "none")]
155 UnstableVariant,
156
157 #[stable(feature = "rust1", since = "1.0.0")]
158 StableVariant,
159 }
160
161 #[stable(feature = "stable_test_feature", since = "1.0.0")]
162 #[deprecated(since = "1.0.0", note = "text")]
163 pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
164 #[unstable(feature = "unstable_test_feature", issue = "none")]
165 #[deprecated(since = "1.0.0", note = "text")]
166 pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
167 #[unstable(feature = "unstable_test_feature", issue = "none")]
168 pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
169 #[stable(feature = "rust1", since = "1.0.0")]
170 pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
171
172 #[stable(feature = "stable_test_feature", since = "1.0.0")]
173 #[macro_export]
174 macro_rules! macro_test {
175 () => (deprecated());
176 }
177
178 #[stable(feature = "stable_test_feature", since = "1.0.0")]
179 #[macro_export]
180 macro_rules! macro_test_arg {
181 ($func:expr) => ($func);
182 }
183
184 #[stable(feature = "stable_test_feature", since = "1.0.0")]
185 #[macro_export]
186 macro_rules! macro_test_arg_nested {
187 ($func:ident) => (macro_test_arg!($func()));
188 }