Skip to content

Commit

Permalink
Rollup merge of rust-lang#99435 - CAD97:revert-dollar-dollar-crate, r…
Browse files Browse the repository at this point in the history
…=Mark-Simulacrum

Revert "Stabilize $$ in Rust 1.63.0"

This mechanically reverts commit 9edaa76, the one commit from rust-lang#95860.

rust-lang#99035; the behavior of `$$crate` is potentially unexpected and not ready to be stabilized. rust-lang#99193 attempts to forbid `$$crate` without also destabilizing `$$` more generally.

`@rustbot` modify labels +T-compiler +T-lang +P-medium +beta-nominated +relnotes

(applying the labels I think are accurate from the issue and alternative partial revert)

cc `@Mark-Simulacrum`
  • Loading branch information
matthiaskrgr authored and ehuss committed Jul 22, 2022
1 parent 6f162b3 commit e6e5bc7
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 19 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_expand/src/mbe/quoted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,8 @@ fn parse_tree(
sess,
&Token { kind: token::Dollar, span },
);
} else {
maybe_emit_macro_metavar_expr_feature(features, sess, span);
}
TokenTree::token(token::Dollar, span)
}
Expand Down
12 changes: 0 additions & 12 deletions src/test/ui/macros/rfc-3086-metavar-expr/allowed-features.rs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ 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()} )*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0658]: meta-variable expressions are unstable
--> $DIR/required-features.rs:3:10
--> $DIR/required-feature.rs:3:10
|
LL | ${ count(e) }
| ^^^^^^^^^^^^
Expand All @@ -8,7 +8,43 @@ LL | ${ count(e) }
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable

error[E0658]: meta-variable expressions are unstable
--> $DIR/required-features.rs:10:13
--> $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
|
LL | $( ${ignore(e)} ${index()} )*
| ^^^^^^^^^^^
Expand All @@ -17,7 +53,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-features.rs:10:26
--> $DIR/required-feature.rs:22:26
|
LL | $( ${ignore(e)} ${index()} )*
| ^^^^^^^^^
Expand All @@ -26,7 +62,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-features.rs:18:19
--> $DIR/required-feature.rs:30:19
|
LL | 0 $( + 1 ${ignore(i)} )*
| ^^^^^^^^^^^
Expand All @@ -35,7 +71,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-features.rs:25:13
--> $DIR/required-feature.rs:37:13
|
LL | $( ${ignore(e)} ${length()} )*
| ^^^^^^^^^^^
Expand All @@ -44,14 +80,14 @@ 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-features.rs:25:26
--> $DIR/required-feature.rs:37:26
|
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 6 previous errors
error: aborting due to 10 previous errors

For more information about this error, try `rustc --explain E0658`.

0 comments on commit e6e5bc7

Please sign in to comment.