validate allow_internal_unstable target
Adds a check to make sure `#[allow_internal_unstable]` can be applied only to macro definitions.
This commit is contained in:
parent
05f4a9a42a
commit
7258740509
3 changed files with 40 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
// this needs a different test since this is done after expansion
|
||||
|
||||
#[allow_internal_unstable()] //~ ERROR allow_internal_unstable side-steps
|
||||
//~| ERROR attribute should
|
||||
struct S;
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,15 @@ LL | #[allow_internal_unstable()]
|
|||
|
|
||||
= help: add `#![feature(allow_internal_unstable)]` to the crate attributes to enable
|
||||
|
||||
error: aborting due to previous error
|
||||
error: attribute should be applied to a macro
|
||||
--> $DIR/feature-gate-allow-internal-unstable-struct.rs:4:1
|
||||
|
|
||||
LL | #[allow_internal_unstable()]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL |
|
||||
LL | struct S;
|
||||
| --------- not a macro
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0658`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue