about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCaio <c410.f3r@gmail.com>2022-06-07 21:50:45 -0300
committerCaio <c410.f3r@gmail.com>2022-06-07 21:50:45 -0300
commit9edaa76adce4de737db54194eb13d6c298827b37 (patch)
treee8f3985fd2f2b86fe5fc7ef743469169cc2583d0
parentb17e9d76f2ad15022e0e69bc33745c4ef9025a8f (diff)
downloadrust-9edaa76adce4de737db54194eb13d6c298827b37.tar.gz
rust-9edaa76adce4de737db54194eb13d6c298827b37.zip
Stabilize $$ in Rust 1.63.0
-rw-r--r--compiler/rustc_expand/src/mbe/quoted.rs2
-rw-r--r--src/test/ui/macros/rfc-3086-metavar-expr/allowed-features.rs12
-rw-r--r--src/test/ui/macros/rfc-3086-metavar-expr/required-features.rs (renamed from src/test/ui/macros/rfc-3086-metavar-expr/required-feature.rs)12
-rw-r--r--src/test/ui/macros/rfc-3086-metavar-expr/required-features.stderr (renamed from src/test/ui/macros/rfc-3086-metavar-expr/required-feature.stderr)50
4 files changed, 19 insertions, 57 deletions
diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs
index 707cb73f097..d4b8563a036 100644
--- a/compiler/rustc_expand/src/mbe/quoted.rs
+++ b/compiler/rustc_expand/src/mbe/quoted.rs
@@ -234,8 +234,6 @@ fn parse_tree(
                             sess,
                             &Token { kind: token::Dollar, span },
                         );
-                    } else {
-                        maybe_emit_macro_metavar_expr_feature(features, sess, span);
                     }
                     TokenTree::token(token::Dollar, span)
                 }
diff --git a/src/test/ui/macros/rfc-3086-metavar-expr/allowed-features.rs b/src/test/ui/macros/rfc-3086-metavar-expr/allowed-features.rs
new file mode 100644
index 00000000000..c248c46f52c
--- /dev/null
+++ b/src/test/ui/macros/rfc-3086-metavar-expr/allowed-features.rs
@@ -0,0 +1,12 @@
+// check-pass
+
+macro_rules! dollar_dollar {
+    () => {
+        macro_rules! bar {
+            ( $$( $$any:tt )* ) => { $$( $$any )* };
+        }
+    };
+}
+
+fn main() {
+}
diff --git a/src/test/ui/macros/rfc-3086-metavar-expr/required-feature.rs b/src/test/ui/macros/rfc-3086-metavar-expr/required-features.rs
index b4fef11f1e2..cce3e578aea 100644
--- a/src/test/ui/macros/rfc-3086-metavar-expr/required-feature.rs
+++ b/src/test/ui/macros/rfc-3086-metavar-expr/required-features.rs
@@ -5,18 +5,6 @@ macro_rules! count {
     };
 }
 
-macro_rules! dollar_dollar {
-    () => {
-        macro_rules! bar {
-            ( $$( $$any:tt )* ) => { $$( $$any )* };
-            //~^ ERROR meta-variable expressions are unstable
-            //~| ERROR meta-variable expressions are unstable
-            //~| ERROR meta-variable expressions are unstable
-            //~| ERROR meta-variable expressions are unstable
-        }
-    };
-}
-
 macro_rules! index {
     ( $( $e:stmt ),* ) => {
         $( ${ignore(e)} ${index()} )*
diff --git a/src/test/ui/macros/rfc-3086-metavar-expr/required-feature.stderr b/src/test/ui/macros/rfc-3086-metavar-expr/required-features.stderr
index ecf598b104d..5efd3b10442 100644
--- a/src/test/ui/macros/rfc-3086-metavar-expr/required-feature.stderr
+++ b/src/test/ui/macros/rfc-3086-metavar-expr/required-features.stderr
@@ -1,5 +1,5 @@
 error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:3:10
+  --> $DIR/required-features.rs:3:10
    |
 LL |         ${ count(e) }
    |          ^^^^^^^^^^^^
@@ -8,43 +8,7 @@ LL |         ${ count(e) }
    = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
 
 error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:11:16
-   |
-LL |             ( $$( $$any:tt )* ) => { $$( $$any )* };
-   |                ^
-   |
-   = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
-   = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
-
-error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:11:20
-   |
-LL |             ( $$( $$any:tt )* ) => { $$( $$any )* };
-   |                    ^
-   |
-   = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
-   = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
-
-error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:11:39
-   |
-LL |             ( $$( $$any:tt )* ) => { $$( $$any )* };
-   |                                       ^
-   |
-   = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
-   = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
-
-error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:11:43
-   |
-LL |             ( $$( $$any:tt )* ) => { $$( $$any )* };
-   |                                           ^
-   |
-   = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
-   = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
-
-error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:22:13
+  --> $DIR/required-features.rs:10:13
    |
 LL |         $( ${ignore(e)} ${index()} )*
    |             ^^^^^^^^^^^
@@ -53,7 +17,7 @@ LL |         $( ${ignore(e)} ${index()} )*
    = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
 
 error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:22:26
+  --> $DIR/required-features.rs:10:26
    |
 LL |         $( ${ignore(e)} ${index()} )*
    |                          ^^^^^^^^^
@@ -62,7 +26,7 @@ LL |         $( ${ignore(e)} ${index()} )*
    = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
 
 error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:30:19
+  --> $DIR/required-features.rs:18:19
    |
 LL |         0 $( + 1 ${ignore(i)} )*
    |                   ^^^^^^^^^^^
@@ -71,7 +35,7 @@ LL |         0 $( + 1 ${ignore(i)} )*
    = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
 
 error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:37:13
+  --> $DIR/required-features.rs:25:13
    |
 LL |         $( ${ignore(e)} ${length()} )*
    |             ^^^^^^^^^^^
@@ -80,7 +44,7 @@ LL |         $( ${ignore(e)} ${length()} )*
    = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
 
 error[E0658]: meta-variable expressions are unstable
-  --> $DIR/required-feature.rs:37:26
+  --> $DIR/required-features.rs:25:26
    |
 LL |         $( ${ignore(e)} ${length()} )*
    |                          ^^^^^^^^^^
@@ -88,6 +52,6 @@ LL |         $( ${ignore(e)} ${length()} )*
    = note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
    = help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
 
-error: aborting due to 10 previous errors
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0658`.