Skip to content

Commit 9edaa76

Browse files
committed
Stabilize $$ in Rust 1.63.0
1 parent b17e9d7 commit 9edaa76

File tree

4 files changed

+19
-57
lines changed

4 files changed

+19
-57
lines changed

compiler/rustc_expand/src/mbe/quoted.rs

-2
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,6 @@ fn parse_tree(
234234
sess,
235235
&Token { kind: token::Dollar, span },
236236
);
237-
} else {
238-
maybe_emit_macro_metavar_expr_feature(features, sess, span);
239237
}
240238
TokenTree::token(token::Dollar, span)
241239
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// check-pass
2+
3+
macro_rules! dollar_dollar {
4+
() => {
5+
macro_rules! bar {
6+
( $$( $$any:tt )* ) => { $$( $$any )* };
7+
}
8+
};
9+
}
10+
11+
fn main() {
12+
}

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

-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,6 @@ 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-
208
macro_rules! index {
219
( $( $e:stmt ),* ) => {
2210
$( ${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-feature.rs:3:10
2+
--> $DIR/required-features.rs:3:10
33
|
44
LL | ${ count(e) }
55
| ^^^^^^^^^^^^
@@ -8,43 +8,7 @@ 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-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
11+
--> $DIR/required-features.rs:10:13
4812
|
4913
LL | $( ${ignore(e)} ${index()} )*
5014
| ^^^^^^^^^^^
@@ -53,7 +17,7 @@ LL | $( ${ignore(e)} ${index()} )*
5317
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
5418

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

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

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

8246
error[E0658]: meta-variable expressions are unstable
83-
--> $DIR/required-feature.rs:37:26
47+
--> $DIR/required-features.rs:25:26
8448
|
8549
LL | $( ${ignore(e)} ${length()} )*
8650
| ^^^^^^^^^^
8751
|
8852
= note: see issue #83527 <https://github.com/rust-lang/rust/issues/83527> for more information
8953
= help: add `#![feature(macro_metavar_expr)]` to the crate attributes to enable
9054

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

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

0 commit comments

Comments
 (0)