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