2016-04-26 12:51:14 -05:00
|
|
|
#![feature(staged_api, allow_internal_unstable)]
|
|
|
|
#![stable(feature = "stable", since = "1.0.0")]
|
|
|
|
|
2019-12-21 05:16:18 -06:00
|
|
|
#[unstable(feature = "function", issue = "none")]
|
2016-04-26 12:51:14 -05:00
|
|
|
pub fn unstable() {}
|
|
|
|
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub struct Foo {
|
2019-12-21 05:16:18 -06:00
|
|
|
#[unstable(feature = "struct_field", issue = "none")]
|
2016-04-26 12:51:14 -05:00
|
|
|
pub x: u8
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Foo {
|
2019-12-21 05:16:18 -06:00
|
|
|
#[unstable(feature = "method", issue = "none")]
|
2016-04-26 12:51:14 -05:00
|
|
|
pub fn method(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub struct Bar {
|
2019-12-21 05:16:18 -06:00
|
|
|
#[unstable(feature = "struct2_field", issue = "none")]
|
2016-04-26 12:51:14 -05:00
|
|
|
pub x: u8
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2019-02-03 05:55:00 -06:00
|
|
|
#[allow_internal_unstable(function)]
|
2016-04-26 12:51:14 -05:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! call_unstable_allow {
|
|
|
|
() => { $crate::unstable() }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2019-02-03 05:55:00 -06:00
|
|
|
#[allow_internal_unstable(struct_field)]
|
2016-04-26 12:51:14 -05:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! construct_unstable_allow {
|
|
|
|
($e: expr) => {
|
|
|
|
$crate::Foo { x: $e }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2019-02-03 05:55:00 -06:00
|
|
|
#[allow_internal_unstable(method)]
|
2016-04-26 12:51:14 -05:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! call_method_allow {
|
|
|
|
($e: expr) => { $e.method() }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2019-02-03 05:55:00 -06:00
|
|
|
#[allow_internal_unstable(struct_field, struct2_field)]
|
2016-04-26 12:51:14 -05:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! access_field_allow {
|
|
|
|
($e: expr) => { $e.x }
|
|
|
|
}
|
|
|
|
|
2020-09-25 07:40:16 -05:00
|
|
|
// regression test for #77088
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
#[allow_internal_unstable(struct_field)]
|
|
|
|
#[allow_internal_unstable(struct2_field)]
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! access_field_allow2 {
|
|
|
|
($e: expr) => { $e.x }
|
|
|
|
}
|
|
|
|
|
2016-04-26 12:51:14 -05:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2019-02-03 05:55:00 -06:00
|
|
|
#[allow_internal_unstable()]
|
2016-04-26 12:51:14 -05:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! pass_through_allow {
|
|
|
|
($e: expr) => { $e }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! call_unstable_noallow {
|
|
|
|
() => { $crate::unstable() }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! construct_unstable_noallow {
|
|
|
|
($e: expr) => {
|
|
|
|
$crate::Foo { x: $e }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! call_method_noallow {
|
|
|
|
($e: expr) => { $e.method() }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! access_field_noallow {
|
|
|
|
($e: expr) => { $e.x }
|
|
|
|
}
|
|
|
|
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
#[macro_export]
|
|
|
|
macro_rules! pass_through_noallow {
|
|
|
|
($e: expr) => { $e }
|
|
|
|
}
|