-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for "const stability on macro"
- Loading branch information
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[rustc_const_stable(feature = "foo", since = "0")] | ||
//~^ ERROR macros cannot have const stability attributes | ||
macro_rules! foo { | ||
() => {}; | ||
} | ||
|
||
#[rustc_const_unstable(feature = "bar", issue="none")] | ||
//~^ ERROR macros cannot have const stability attributes | ||
macro_rules! bar { | ||
() => {}; | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
error: macros cannot have const stability attributes | ||
--> $DIR/const-stability-on-macro.rs:1:1 | ||
| | ||
LL | #[rustc_const_stable(feature = "foo", since = "0")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute | ||
LL | | ||
LL | macro_rules! foo { | ||
| ---------------- const stability attribute affects this macro | ||
|
||
error: macros cannot have const stability attributes | ||
--> $DIR/const-stability-on-macro.rs:7:1 | ||
| | ||
LL | #[rustc_const_unstable(feature = "bar", issue="none")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid const stability attribute | ||
LL | | ||
LL | macro_rules! bar { | ||
| ---------------- const stability attribute affects this macro | ||
|
||
error: aborting due to 2 previous errors | ||
|