]>
Commit | Line | Data |
---|---|---|
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 |
5 | pub fn unstable() {} |
6 | ||
7 | ||
8 | #[stable(feature = "stable", since = "1.0.0")] | |
9 | pub struct Foo { | |
e9174d1e | 10 | #[unstable(feature = "struct_field", issue = "0")] |
c34b1796 AL |
11 | pub x: u8 |
12 | } | |
13 | ||
9346a6ac | 14 | impl 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")] | |
20 | pub 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] |
28 | macro_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] |
35 | macro_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] |
44 | macro_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] |
51 | macro_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] |
58 | macro_rules! pass_through_allow { | |
59 | ($e: expr) => { $e } | |
60 | } | |
61 | ||
92a42be0 | 62 | #[stable(feature = "stable", since = "1.0.0")] |
c34b1796 AL |
63 | #[macro_export] |
64 | macro_rules! call_unstable_noallow { | |
65 | () => { $crate::unstable() } | |
66 | } | |
67 | ||
92a42be0 | 68 | #[stable(feature = "stable", since = "1.0.0")] |
c34b1796 AL |
69 | #[macro_export] |
70 | macro_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] |
78 | macro_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] |
84 | macro_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] |
90 | macro_rules! pass_through_noallow { | |
91 | ($e: expr) => { $e } | |
92 | } |