diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2020-10-21 00:46:29 +0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2021-02-19 13:52:57 -0300 |
| commit | 0fddc2f780b7d075797364386a77b5f2f3bf909b (patch) | |
| tree | 5dc1c7b23926cb67136373736b4b09bb802b5b9e /src/test/ui/feature-gates | |
| parent | 25a2c13e9d19c18d5f3c2656e3d2dda086cb023b (diff) | |
| download | rust-0fddc2f780b7d075797364386a77b5f2f3bf909b.tar.gz rust-0fddc2f780b7d075797364386a77b5f2f3bf909b.zip | |
Support `pub` on `macro_rules`
Diffstat (limited to 'src/test/ui/feature-gates')
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-pub_macro_rules.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/feature-gates/feature-gate-pub_macro_rules.stderr | 39 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/test/ui/feature-gates/feature-gate-pub_macro_rules.rs b/src/test/ui/feature-gates/feature-gate-pub_macro_rules.rs new file mode 100644 index 00000000000..5504ec317ae --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-pub_macro_rules.rs @@ -0,0 +1,10 @@ +pub macro_rules! m1 { () => {} } //~ ERROR `pub` on `macro_rules` items is unstable + +#[cfg(FALSE)] +pub macro_rules! m2 { () => {} } //~ ERROR `pub` on `macro_rules` items is unstable + +pub(crate) macro_rules! m3 { () => {} } //~ ERROR `pub` on `macro_rules` items is unstable + +pub(in self) macro_rules! m4 { () => {} } //~ ERROR `pub` on `macro_rules` items is unstable + +fn main() {} diff --git a/src/test/ui/feature-gates/feature-gate-pub_macro_rules.stderr b/src/test/ui/feature-gates/feature-gate-pub_macro_rules.stderr new file mode 100644 index 00000000000..bfaec398d9a --- /dev/null +++ b/src/test/ui/feature-gates/feature-gate-pub_macro_rules.stderr @@ -0,0 +1,39 @@ +error[E0658]: `pub` on `macro_rules` items is unstable + --> $DIR/feature-gate-pub_macro_rules.rs:1:1 + | +LL | pub macro_rules! m1 { () => {} } + | ^^^ + | + = note: see issue #78855 <https://github.com/rust-lang/rust/issues/78855> for more information + = help: add `#![feature(pub_macro_rules)]` to the crate attributes to enable + +error[E0658]: `pub` on `macro_rules` items is unstable + --> $DIR/feature-gate-pub_macro_rules.rs:4:1 + | +LL | pub macro_rules! m2 { () => {} } + | ^^^ + | + = note: see issue #78855 <https://github.com/rust-lang/rust/issues/78855> for more information + = help: add `#![feature(pub_macro_rules)]` to the crate attributes to enable + +error[E0658]: `pub` on `macro_rules` items is unstable + --> $DIR/feature-gate-pub_macro_rules.rs:6:1 + | +LL | pub(crate) macro_rules! m3 { () => {} } + | ^^^^^^^^^^ + | + = note: see issue #78855 <https://github.com/rust-lang/rust/issues/78855> for more information + = help: add `#![feature(pub_macro_rules)]` to the crate attributes to enable + +error[E0658]: `pub` on `macro_rules` items is unstable + --> $DIR/feature-gate-pub_macro_rules.rs:8:1 + | +LL | pub(in self) macro_rules! m4 { () => {} } + | ^^^^^^^^^^^^ + | + = note: see issue #78855 <https://github.com/rust-lang/rust/issues/78855> for more information + = help: add `#![feature(pub_macro_rules)]` to the crate attributes to enable + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0658`. |
