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;
22 #[stable(feature = "rust1", since = "1.0.0")]
23 pub use super::lint_stability_fields::*;
26 use self::lint_stability_fields::*;
31 override1: 2, //~ ERROR use of unstable
32 override2: 3, //~ ERROR use of unstable
36 let _ = x.override1; //~ ERROR use of unstable
37 let _ = x.override2; //~ ERROR use of unstable
41 override1: _, //~ ERROR use of unstable
42 override2: _ //~ ERROR use of unstable
45 let Stable { .. } = x;
47 let x = Stable2(1, 2, 3);
50 let _ = x.1; //~ ERROR use of unstable
51 let _ = x.2; //~ ERROR use of unstable
54 _, //~ ERROR use of unstable
55 _) //~ ERROR use of unstable
61 let x = Unstable { //~ ERROR use of unstable
62 inherit: 1, //~ ERROR use of unstable
64 override2: 3, //~ ERROR use of unstable
67 let _ = x.inherit; //~ ERROR use of unstable
69 let _ = x.override2; //~ ERROR use of unstable
71 let Unstable { //~ ERROR use of unstable
72 inherit: _, //~ ERROR use of unstable
74 override2: _ //~ ERROR use of unstable
77 let Unstable //~ ERROR use of unstable
78 // the patterns are all fine:
81 // Unstable items are still unstable even when used through a stable "pub use".
82 let x = reexport::Unstable2(1, 2, 3); //~ ERROR use of unstable
84 let x = Unstable2(1, 2, 3); //~ ERROR use of unstable
86 let _ = x.0; //~ ERROR use of unstable
88 let _ = x.2; //~ ERROR use of unstable
90 let Unstable2 //~ ERROR use of unstable
91 (_, //~ ERROR use of unstable
93 _) //~ ERROR use of unstable
95 let Unstable2 //~ ERROR use of unstable
96 // the patterns are all fine:
100 let x = Deprecated { //~ ERROR use of unstable
101 inherit: 1, //~ ERROR use of unstable
103 override2: 3, //~ ERROR use of unstable
106 let _ = x.inherit; //~ ERROR use of unstable
108 let _ = x.override2; //~ ERROR use of unstable
110 let Deprecated { //~ ERROR use of unstable
111 inherit: _, //~ ERROR use of unstable
113 override2: _ //~ ERROR use of unstable
116 let Deprecated //~ ERROR use of unstable
117 // the patterns are all fine:
120 let x = Deprecated2(1, 2, 3); //~ ERROR use of unstable
122 let _ = x.0; //~ ERROR use of unstable
124 let _ = x.2; //~ ERROR use of unstable
126 let Deprecated2 //~ ERROR use of unstable
127 (_, //~ ERROR use of unstable
129 _) //~ ERROR use of unstable
131 let Deprecated2 //~ ERROR use of unstable
132 // the patterns are all fine:
138 #[stable(feature = "rust1", since = "1.0.0")]
141 #[unstable(feature = "unstable_test_feature", issue = "0")]
143 #[rustc_deprecated(since = "1.0.0", reason = "text")]
144 #[unstable(feature = "unstable_test_feature", issue = "0")]
148 #[stable(feature = "rust1", since = "1.0.0")]
150 #[stable(feature = "rust1", since = "1.0.0")] u8,
151 #[unstable(feature = "unstable_test_feature", issue = "0")]
152 #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
154 #[unstable(feature = "unstable_test_feature", issue = "0")]
157 #[stable(feature = "rust1", since = "1.0.0")]
159 #[rustc_deprecated(since = "1.0.0", reason = "text")]
160 #[unstable(feature = "unstable_test_feature", issue = "0")]
164 #[unstable(feature = "unstable_test_feature", issue = "0")]
166 #[stable(feature = "rust1", since = "1.0.0")] u8,
167 #[unstable(feature = "unstable_test_feature", issue = "0")]
168 #[rustc_deprecated(since = "1.0.0", reason = "text")] u8);
170 #[unstable(feature = "unstable_test_feature", issue = "0")]
171 #[rustc_deprecated(since = "1.0.0", reason = "text")]
174 #[stable(feature = "rust1", since = "1.0.0")]
176 #[unstable(feature = "unstable_test_feature", issue = "0")]
180 #[unstable(feature = "unstable_test_feature", issue = "0")]
181 #[rustc_deprecated(since = "1.0.0", reason = "text")]
182 struct Deprecated2(u8,
183 #[stable(feature = "rust1", since = "1.0.0")] u8,
184 #[unstable(feature = "unstable_test_feature", issue = "0")] u8);
203 let Stable { .. } = x;
205 let x = Stable2(1, 2, 3);
236 // the patterns are all fine:
240 let x = Unstable2(1, 2, 3);
252 // the patterns are all fine:
273 // the patterns are all fine:
276 let x = Deprecated2(1, 2, 3);
288 // the patterns are all fine: