]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/lint-stability-fields.rs
1 // Copyright 2015 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.
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.
11 // aux-build:lint_stability_fields.rs
14 #![feature(staged_api)]
18 extern crate lint_stability_fields
;
20 use self::lint_stability_fields
::*;
25 override1
: 2, //~ ERROR use of unstable
27 //~^ ERROR use of deprecated item
28 //~^^ ERROR use of unstable
32 let _
= x
.override1
; //~ ERROR use of unstable
34 //~^ ERROR use of deprecated item
35 //~^^ ERROR use of unstable
39 override1
: _
, //~ ERROR use of unstable
41 //~^ ERROR use of deprecated item
42 //~^^ ERROR use of unstable
45 let Stable { .. }
= x
;
47 let x
= Stable2(1, 2, 3);
50 let _
= x
.1; //~ ERROR use of unstable
52 //~^ ERROR use of deprecated item
53 //~^^ ERROR use of unstable
56 _
, //~ ERROR use of unstable
58 //~^ ERROR use of deprecated item
59 //~^^ ERROR use of unstable
65 let x
= Unstable
{ //~ ERROR use of unstable
66 inherit
: 1, //~ ERROR use of unstable
69 //~^ ERROR use of deprecated item
70 //~^^ ERROR use of unstable
73 let _
= x
.inherit
; //~ ERROR use of unstable
76 //~^ ERROR use of deprecated item
77 //~^^ ERROR use of unstable
79 let Unstable
{ //~ ERROR use of unstable
80 inherit
: _
, //~ ERROR use of unstable
83 //~^ ERROR use of deprecated item
84 //~^^ ERROR use of unstable
87 let Unstable
//~ ERROR use of unstable
88 // the patterns are all fine:
92 let x
= Unstable2(1, 2, 3); //~ ERROR use of unstable
94 let _
= x
.0; //~ ERROR use of unstable
97 //~^ ERROR use of deprecated item
98 //~^^ ERROR use of unstable
100 let Unstable2
//~ ERROR use of unstable
101 (_
, //~ ERROR use of unstable
104 //~^ ERROR use of deprecated item
105 //~^^ ERROR use of unstable
107 let Unstable2
//~ ERROR use of unstable
108 // the patterns are all fine:
113 //~^ ERROR use of deprecated item
114 //~^^ ERROR use of unstable
116 //~^ ERROR use of deprecated item
117 //~^^ ERROR use of unstable
119 //~^ ERROR use of deprecated item
121 //~^ ERROR use of deprecated item
122 //~^^ ERROR use of unstable
126 //~^ ERROR use of deprecated item
127 //~^^ ERROR use of unstable
129 //~^ ERROR use of deprecated item
131 //~^ ERROR use of deprecated item
132 //~^^ ERROR use of unstable
135 //~^ ERROR use of deprecated item
136 //~^^ ERROR use of unstable
138 //~^ ERROR use of deprecated item
139 //~^^ ERROR use of unstable
141 //~^ ERROR use of deprecated item
143 //~^ ERROR use of unstable
144 //~^^ ERROR use of deprecated item
148 //~^ ERROR use of deprecated item
149 //~^^ ERROR use of unstable
150 // the patterns are all fine:
153 let x
= Deprecated2(1, 2, 3);
154 //~^ ERROR use of deprecated item
155 //~^^ ERROR use of unstable
158 //~^ ERROR use of deprecated item
159 //~^^ ERROR use of unstable
161 //~^ ERROR use of deprecated item
163 //~^ ERROR use of deprecated item
164 //~^^ ERROR use of unstable
167 //~^ ERROR use of deprecated item
168 //~^^ ERROR use of unstable
170 //~^ ERROR use of deprecated item
171 //~^^ ERROR use of unstable
173 //~^ ERROR use of deprecated item
175 //~^ ERROR use of deprecated item
176 //~^^ ERROR use of unstable
179 //~^ ERROR use of deprecated item
180 //~^^ ERROR use of unstable
181 // the patterns are all fine:
187 #[stable(feature = "rust1", since = "1.0.0")]
190 #[unstable(feature = "test_feature", issue = "0")]
192 #[deprecated(since = "1.0.0", reason = "text")]
193 #[unstable(feature = "test_feature", issue = "0")]
197 #[stable(feature = "rust1", since = "1.0.0")]
199 #[stable(feature = "rust1", since = "1.0.0")] u8,
200 #[unstable(feature = "test_feature", issue = "0")]
201 #[deprecated(since = "1.0.0", reason = "text")] u8);
203 #[unstable(feature = "test_feature", issue = "0")]
206 #[stable(feature = "rust1", since = "1.0.0")]
208 #[deprecated(since = "1.0.0", reason = "text")]
209 #[unstable(feature = "test_feature", issue = "0")]
213 #[unstable(feature = "test_feature", issue = "0")]
215 #[stable(feature = "rust1", since = "1.0.0")] u8,
216 #[unstable(feature = "test_feature", issue = "0")]
217 #[deprecated(since = "1.0.0", reason = "text")] u8);
219 #[unstable(feature = "test_feature", issue = "0")]
220 #[deprecated(since = "1.0.0", reason = "text")]
223 #[stable(feature = "rust1", since = "1.0.0")]
225 #[unstable(feature = "test_feature", issue = "0")]
229 #[unstable(feature = "test_feature", issue = "0")]
230 #[deprecated(since = "1.0.0", reason = "text")]
231 struct Deprecated2(u8,
232 #[stable(feature = "rust1", since = "1.0.0")] u8,
233 #[unstable(feature = "test_feature", issue = "0")] u8);
240 //~^ ERROR use of deprecated item
246 //~^ ERROR use of deprecated item
252 //~^ ERROR use of deprecated item
255 let Stable { .. }
= x
;
257 let x
= Stable2(1, 2, 3);
262 //~^ ERROR use of deprecated item
267 //~^ ERROR use of deprecated item
277 //~^ ERROR use of deprecated item
283 //~^ ERROR use of deprecated item
289 //~^ ERROR use of deprecated item
293 // the patterns are all fine:
297 let x
= Unstable2(1, 2, 3);
302 //~^ ERROR use of deprecated item
308 //~^ ERROR use of deprecated item
311 // the patterns are all fine:
316 //~^ ERROR use of deprecated item
318 //~^ ERROR use of deprecated item
320 //~^ ERROR use of deprecated item
322 //~^ ERROR use of deprecated item
326 //~^ ERROR use of deprecated item
328 //~^ ERROR use of deprecated item
330 //~^ ERROR use of deprecated item
333 //~^ ERROR use of deprecated item
335 //~^ ERROR use of deprecated item
337 //~^ ERROR use of deprecated item
339 //~^ ERROR use of deprecated item
343 //~^ ERROR use of deprecated item
344 // the patterns are all fine:
347 let x
= Deprecated2(1, 2, 3);
348 //~^ ERROR use of deprecated item
351 //~^ ERROR use of deprecated item
353 //~^ ERROR use of deprecated item
355 //~^ ERROR use of deprecated item
358 //~^ ERROR use of deprecated item
360 //~^ ERROR use of deprecated item
362 //~^ ERROR use of deprecated item
364 //~^ ERROR use of deprecated item
367 //~^ ERROR use of deprecated item
368 // the patterns are all fine: