]>
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)]
16 #![stable(feature = "rust1", since = "1.0.0")]
19 extern crate lint_stability_fields
;
21 use self::lint_stability_fields
::*;
26 override1
: 2, //~ ERROR use of unstable
28 //~^ ERROR use of deprecated item
29 //~^^ ERROR use of unstable
33 let _
= x
.override1
; //~ ERROR use of unstable
35 //~^ ERROR use of deprecated item
36 //~^^ ERROR use of unstable
40 override1
: _
, //~ ERROR use of unstable
42 //~^ ERROR use of deprecated item
43 //~^^ ERROR use of unstable
46 let Stable { .. }
= x
;
48 let x
= Stable2(1, 2, 3);
51 let _
= x
.1; //~ ERROR use of unstable
53 //~^ ERROR use of deprecated item
54 //~^^ ERROR use of unstable
57 _
, //~ ERROR use of unstable
59 //~^ ERROR use of deprecated item
60 //~^^ ERROR use of unstable
66 let x
= Unstable
{ //~ ERROR use of unstable
67 inherit
: 1, //~ ERROR use of unstable
70 //~^ ERROR use of deprecated item
71 //~^^ ERROR use of unstable
74 let _
= x
.inherit
; //~ ERROR use of unstable
77 //~^ ERROR use of deprecated item
78 //~^^ ERROR use of unstable
80 let Unstable
{ //~ ERROR use of unstable
81 inherit
: _
, //~ ERROR use of unstable
84 //~^ ERROR use of deprecated item
85 //~^^ ERROR use of unstable
88 let Unstable
//~ ERROR use of unstable
89 // the patterns are all fine:
93 let x
= Unstable2(1, 2, 3); //~ ERROR use of unstable
95 let _
= x
.0; //~ ERROR use of unstable
98 //~^ ERROR use of deprecated item
99 //~^^ ERROR use of unstable
101 let Unstable2
//~ ERROR use of unstable
102 (_
, //~ ERROR use of unstable
105 //~^ ERROR use of deprecated item
106 //~^^ ERROR use of unstable
108 let Unstable2
//~ ERROR use of unstable
109 // the patterns are all fine:
114 //~^ ERROR use of deprecated item
115 //~^^ ERROR use of unstable
117 //~^ ERROR use of deprecated item
118 //~^^ ERROR use of unstable
120 //~^ ERROR use of deprecated item
122 //~^ ERROR use of deprecated item
123 //~^^ ERROR use of unstable
127 //~^ ERROR use of deprecated item
128 //~^^ ERROR use of unstable
130 //~^ ERROR use of deprecated item
132 //~^ ERROR use of deprecated item
133 //~^^ ERROR use of unstable
136 //~^ ERROR use of deprecated item
137 //~^^ ERROR use of unstable
139 //~^ ERROR use of deprecated item
140 //~^^ ERROR use of unstable
142 //~^ ERROR use of deprecated item
144 //~^ ERROR use of unstable
145 //~^^ ERROR use of deprecated item
149 //~^ ERROR use of deprecated item
150 //~^^ ERROR use of unstable
151 // the patterns are all fine:
154 let x
= Deprecated2(1, 2, 3);
155 //~^ ERROR use of deprecated item
156 //~^^ ERROR use of unstable
159 //~^ ERROR use of deprecated item
160 //~^^ ERROR use of unstable
162 //~^ ERROR use of deprecated item
164 //~^ ERROR use of deprecated item
165 //~^^ ERROR use of unstable
168 //~^ ERROR use of deprecated item
169 //~^^ ERROR use of unstable
171 //~^ ERROR use of deprecated item
172 //~^^ ERROR use of unstable
174 //~^ ERROR use of deprecated item
176 //~^ ERROR use of deprecated item
177 //~^^ ERROR use of unstable
180 //~^ ERROR use of deprecated item
181 //~^^ ERROR use of unstable
182 // the patterns are all fine:
188 #[stable(feature = "rust1", since = "1.0.0")]
191 #[unstable(feature = "test_feature", issue = "0")]
193 #[rustc_deprecated(since = "1.0.0", reason = "text")]
194 #[unstable(feature = "test_feature", issue = "0")]
198 #[stable(feature = "rust1", since = "1.0.0")]
200 #[stable(feature = "rust1", since = "1.0.0")] u8,
201 #[unstable(feature = "test_feature", issue = "0")]
202 #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
204 #[unstable(feature = "test_feature", issue = "0")]
207 #[stable(feature = "rust1", since = "1.0.0")]
209 #[rustc_deprecated(since = "1.0.0", reason = "text")]
210 #[unstable(feature = "test_feature", issue = "0")]
214 #[unstable(feature = "test_feature", issue = "0")]
216 #[stable(feature = "rust1", since = "1.0.0")] u8,
217 #[unstable(feature = "test_feature", issue = "0")]
218 #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
220 #[unstable(feature = "test_feature", issue = "0")]
221 #[rustc_deprecated(since = "1.0.0", reason = "text")]
224 #[stable(feature = "rust1", since = "1.0.0")]
226 #[unstable(feature = "test_feature", issue = "0")]
230 #[unstable(feature = "test_feature", issue = "0")]
231 #[rustc_deprecated(since = "1.0.0", reason = "text")]
232 struct Deprecated2(u8,
233 #[stable(feature = "rust1", since = "1.0.0")] u8,
234 #[unstable(feature = "test_feature", issue = "0")] u8);
241 //~^ ERROR use of deprecated item
247 //~^ ERROR use of deprecated item
253 //~^ ERROR use of deprecated item
256 let Stable { .. }
= x
;
258 let x
= Stable2(1, 2, 3);
263 //~^ ERROR use of deprecated item
268 //~^ ERROR use of deprecated item
278 //~^ ERROR use of deprecated item
284 //~^ ERROR use of deprecated item
290 //~^ ERROR use of deprecated item
294 // the patterns are all fine:
298 let x
= Unstable2(1, 2, 3);
303 //~^ ERROR use of deprecated item
309 //~^ ERROR use of deprecated item
312 // the patterns are all fine:
317 //~^ ERROR use of deprecated item
319 //~^ ERROR use of deprecated item
321 //~^ ERROR use of deprecated item
323 //~^ ERROR use of deprecated item
327 //~^ ERROR use of deprecated item
329 //~^ ERROR use of deprecated item
331 //~^ ERROR use of deprecated item
334 //~^ ERROR use of deprecated item
336 //~^ ERROR use of deprecated item
338 //~^ ERROR use of deprecated item
340 //~^ ERROR use of deprecated item
344 //~^ ERROR use of deprecated item
345 // the patterns are all fine:
348 let x
= Deprecated2(1, 2, 3);
349 //~^ ERROR use of deprecated item
352 //~^ ERROR use of deprecated item
354 //~^ ERROR use of deprecated item
356 //~^ ERROR use of deprecated item
359 //~^ ERROR use of deprecated item
361 //~^ ERROR use of deprecated item
363 //~^ ERROR use of deprecated item
365 //~^ ERROR use of deprecated item
368 //~^ ERROR use of deprecated item
369 // the patterns are all fine: