]> git.proxmox.com Git - rustc.git/blame - src/test/ui/internal/auxiliary/internal_unstable.rs
New upstream version 1.34.2+dfsg1
[rustc.git] / src / test / ui / internal / auxiliary / internal_unstable.rs
CommitLineData
c34b1796 1#![feature(staged_api, allow_internal_unstable)]
c34b1796
AL
2#![stable(feature = "stable", since = "1.0.0")]
3
e9174d1e 4#[unstable(feature = "function", issue = "0")]
c34b1796
AL
5pub fn unstable() {}
6
7
8#[stable(feature = "stable", since = "1.0.0")]
9pub struct Foo {
e9174d1e 10 #[unstable(feature = "struct_field", issue = "0")]
c34b1796
AL
11 pub x: u8
12}
13
9346a6ac 14impl Foo {
e9174d1e 15 #[unstable(feature = "method", issue = "0")]
9346a6ac
AL
16 pub fn method(&self) {}
17}
18
19#[stable(feature = "stable", since = "1.0.0")]
20pub struct Bar {
e9174d1e 21 #[unstable(feature = "struct2_field", issue = "0")]
9346a6ac
AL
22 pub x: u8
23}
24
92a42be0 25#[stable(feature = "stable", since = "1.0.0")]
9fa01778 26#[allow_internal_unstable(function)]
c34b1796
AL
27#[macro_export]
28macro_rules! call_unstable_allow {
29 () => { $crate::unstable() }
30}
31
92a42be0 32#[stable(feature = "stable", since = "1.0.0")]
9fa01778 33#[allow_internal_unstable(struct_field)]
c34b1796
AL
34#[macro_export]
35macro_rules! construct_unstable_allow {
36 ($e: expr) => {
37 $crate::Foo { x: $e }
38 }
39}
40
92a42be0 41#[stable(feature = "stable", since = "1.0.0")]
9fa01778 42#[allow_internal_unstable(method)]
9346a6ac
AL
43#[macro_export]
44macro_rules! call_method_allow {
45 ($e: expr) => { $e.method() }
46}
47
92a42be0 48#[stable(feature = "stable", since = "1.0.0")]
9fa01778 49#[allow_internal_unstable(struct_field, struct2_field)]
9346a6ac
AL
50#[macro_export]
51macro_rules! access_field_allow {
52 ($e: expr) => { $e.x }
53}
54
92a42be0 55#[stable(feature = "stable", since = "1.0.0")]
9fa01778 56#[allow_internal_unstable()]
c34b1796
AL
57#[macro_export]
58macro_rules! pass_through_allow {
59 ($e: expr) => { $e }
60}
61
92a42be0 62#[stable(feature = "stable", since = "1.0.0")]
c34b1796
AL
63#[macro_export]
64macro_rules! call_unstable_noallow {
65 () => { $crate::unstable() }
66}
67
92a42be0 68#[stable(feature = "stable", since = "1.0.0")]
c34b1796
AL
69#[macro_export]
70macro_rules! construct_unstable_noallow {
71 ($e: expr) => {
72 $crate::Foo { x: $e }
73 }
74}
75
92a42be0 76#[stable(feature = "stable", since = "1.0.0")]
9346a6ac
AL
77#[macro_export]
78macro_rules! call_method_noallow {
79 ($e: expr) => { $e.method() }
80}
81
92a42be0 82#[stable(feature = "stable", since = "1.0.0")]
9346a6ac
AL
83#[macro_export]
84macro_rules! access_field_noallow {
85 ($e: expr) => { $e.x }
86}
87
92a42be0 88#[stable(feature = "stable", since = "1.0.0")]
c34b1796
AL
89#[macro_export]
90macro_rules! pass_through_noallow {
91 ($e: expr) => { $e }
92}