Skip to content

Commit 19932a5

Browse files
authoredJul 19, 2022
Rollup merge of rust-lang#99435 - CAD97:revert-dollar-dollar-crate, r=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`
2 parents 7d75497 + c0569f2 commit 19932a5

File tree

4 files changed

+57
-19
lines changed

4 files changed

+57
-19
lines changed
 

‎compiler/rustc_expand/src/mbe/quoted.rs

+2
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ fn parse_tree(
234234
sess,
235235
&Token { kind: token::Dollar, span },
236236
);
237+
} else {
238+
maybe_emit_macro_metavar_expr_feature(features, sess, span);
237239
}
238240
TokenTree::token(token::Dollar, span)
239241
}

‎src/test/ui/macros/rfc-3086-metavar-expr/allowed-features.rs

-12
This file was deleted.

‎src/test/ui/macros/rfc-3086-metavar-expr/required-features.rs ‎src/test/ui/macros/rfc-3086-metavar-expr/required-feature.rs

+12
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ macro_rules! count {
55
};
66
}
77

8+
macro_rules! dollar_dollar {
9+
() => {
10+
macro_rules! bar {
11+
( $$( $$any:tt )* ) => { $$( $$any )* };
12+
//~^ ERROR meta-variable expressions are unstable
13+
//~| ERROR meta-variable expressions are unstable
14+
//~| ERROR meta-variable expressions are unstable
15+
//~| ERROR meta-variable expressions are unstable
16+
}
17+
};
18+
}
19+
820
macro_rules! index {
921
( $( $e:stmt ),* ) => {
1022
$( ${ignore(e)} ${index()} )*
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0658]: meta-variable expressions are unstable
2-
--> $DIR/required-features.rs:3:10
2+
--> $DIR/required-feature.rs:3:10
33
|
44
LL | ${ count(e) }
55
| ^^^^^^^^^^^^
@@ -8,7 +8,43 @@ LL | ${ count(e) }
88
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
99

1010
error[E0658]: meta-variable expressions are unstable
11-
--> $DIR/required-features.rs:10:13
11+
--> $DIR/required-feature.rs:11:16
12+
|
13+
LL | ( $$( $$any:tt )* ) => { $$( $$any )* };
14+
| ^
15+
|
16+
= note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
17+
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
18+
19+
error[E0658]: meta-variable expressions are unstable
20+
--> $DIR/required-feature.rs:11:20
21+
|
22+
LL | ( $$( $$any:tt )* ) => { $$( $$any )* };
23+
| ^
24+
|
25+
= note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
26+
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
27+
28+
error[E0658]: meta-variable expressions are unstable
29+
--> $DIR/required-feature.rs:11:39
30+
|
31+
LL | ( $$( $$any:tt )* ) => { $$( $$any )* };
32+
| ^
33+
|
34+
= note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
35+
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
36+
37+
error[E0658]: meta-variable expressions are unstable
38+
--> $DIR/required-feature.rs:11:43
39+
|
40+
LL | ( $$( $$any:tt )* ) => { $$( $$any )* };
41+
| ^
42+
|
43+
= note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
44+
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
45+
46+
error[E0658]: meta-variable expressions are unstable
47+
--> $DIR/required-feature.rs:22:13
1248
|
1349
LL | $( ${ignore(e)} ${index()} )*
1450
| ^^^^^^^^^^^
@@ -17,7 +53,7 @@ LL | $( ${ignore(e)} ${index()} )*
1753
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
1854

1955
error[E0658]: meta-variable expressions are unstable
20-
--> $DIR/required-features.rs:10:26
56+
--> $DIR/required-feature.rs:22:26
2157
|
2258
LL | $( ${ignore(e)} ${index()} )*
2359
| ^^^^^^^^^
@@ -26,7 +62,7 @@ LL | $( ${ignore(e)} ${index()} )*
2662
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
2763

2864
error[E0658]: meta-variable expressions are unstable
29-
--> $DIR/required-features.rs:18:19
65+
--> $DIR/required-feature.rs:30:19
3066
|
3167
LL | 0 $( + 1 ${ignore(i)} )*
3268
| ^^^^^^^^^^^
@@ -35,7 +71,7 @@ LL | 0 $( + 1 ${ignore(i)} )*
3571
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
3672

3773
error[E0658]: meta-variable expressions are unstable
38-
--> $DIR/required-features.rs:25:13
74+
--> $DIR/required-feature.rs:37:13
3975
|
4076
LL | $( ${ignore(e)} ${length()} )*
4177
| ^^^^^^^^^^^
@@ -44,14 +80,14 @@ LL | $( ${ignore(e)} ${length()} )*
4480
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
4581

4682
error[E0658]: meta-variable expressions are unstable
47-
--> $DIR/required-features.rs:25:26
83+
--> $DIR/required-feature.rs:37:26
4884
|
4985
LL | $( ${ignore(e)} ${length()} )*
5086
| ^^^^^^^^^^
5187
|
5288
= note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
5389
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
5490

55-
error: aborting due to 6 previous errors
91+
error: aborting due to 10 previous errors
5692

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

0 commit comments

Comments
 (0)
Please sign in to comment.