Auto merge of #58098 - oli-obk:maybe_allow_internal_unstable, r=petrochenkov

Require a list of features in `#[allow_internal_unstable]`

The blanket-permission slip is not great and will likely give us trouble some point down the road.
This commit is contained in:
bors 2019-02-12 12:10:10 +00:00
commit c84e797642
41 changed files with 622 additions and 512 deletions

View file

@ -5,7 +5,7 @@
macro_rules! bar {
() => {
// more layers don't help:
#[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
macro_rules! baz {
() => {}
}

View file

@ -1,8 +1,8 @@
error[E0658]: allow_internal_unstable side-steps feature gating and stability checks
--> $DIR/feature-gate-allow-internal-unstable-nested-macro.rs:8:9
|
LL | #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | bar!();
| ------- in this macro invocation

View file

@ -1,7 +1,7 @@
// checks that this attribute is caught on non-macro items.
// this needs a different test since this is done after expansion
#[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
struct S;
fn main() {}

View file

@ -1,8 +1,8 @@
error[E0658]: allow_internal_unstable side-steps feature gating and stability checks
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
|
LL | #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(allow_internal_unstable)] to the crate attributes to enable

View file

@ -1,6 +1,6 @@
#![allow(unused_macros)]
#[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
macro_rules! foo {
() => {}
}

View file

@ -1,8 +1,8 @@
error[E0658]: allow_internal_unstable side-steps feature gating and stability checks
--> $DIR/feature-gate-allow-internal-unstable.rs:3:1
|
LL | #[allow_internal_unstable] //~ ERROR allow_internal_unstable side-steps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
LL | #[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add #![feature(allow_internal_unstable)] to the crate attributes to enable

View file

@ -23,14 +23,14 @@ pub struct Bar {
}
#[stable(feature = "stable", since = "1.0.0")]
#[allow_internal_unstable]
#[allow_internal_unstable(function)]
#[macro_export]
macro_rules! call_unstable_allow {
() => { $crate::unstable() }
}
#[stable(feature = "stable", since = "1.0.0")]
#[allow_internal_unstable]
#[allow_internal_unstable(struct_field)]
#[macro_export]
macro_rules! construct_unstable_allow {
($e: expr) => {
@ -39,21 +39,21 @@ macro_rules! construct_unstable_allow {
}
#[stable(feature = "stable", since = "1.0.0")]
#[allow_internal_unstable]
#[allow_internal_unstable(method)]
#[macro_export]
macro_rules! call_method_allow {
($e: expr) => { $e.method() }
}
#[stable(feature = "stable", since = "1.0.0")]
#[allow_internal_unstable]
#[allow_internal_unstable(struct_field, struct2_field)]
#[macro_export]
macro_rules! access_field_allow {
($e: expr) => { $e.x }
}
#[stable(feature = "stable", since = "1.0.0")]
#[allow_internal_unstable]
#[allow_internal_unstable()]
#[macro_export]
macro_rules! pass_through_allow {
($e: expr) => { $e }

View file

@ -13,7 +13,7 @@ macro_rules! foo {
}}
}
#[allow_internal_unstable]
#[allow_internal_unstable(function)]
macro_rules! bar {
($e: expr) => {{
foo!($e,