Skip to content

Commit 93b1119

Browse files
committed
Stabilize meta variables expressions
1 parent 1388d7a commit 93b1119

22 files changed

+173
-276
lines changed

compiler/rustc_data_structures/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#![allow(internal_features)]
1111
#![allow(rustc::default_hash_types)]
1212
#![allow(rustc::potential_query_instability)]
13+
#![cfg_attr(bootstrap, feature(macro_metavar_expr))]
1314
#![cfg_attr(not(parallel_compiler), feature(cell_leak))]
1415
#![deny(unsafe_op_in_unsafe_fn)]
1516
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
@@ -25,7 +26,6 @@
2526
#![feature(hasher_prefixfree_extras)]
2627
#![feature(lazy_cell)]
2728
#![feature(lint_reasons)]
28-
#![feature(macro_metavar_expr)]
2929
#![feature(maybe_uninit_uninit_array)]
3030
#![feature(min_specialization)]
3131
#![feature(negative_impls)]

compiler/rustc_data_structures/src/tagged_ptr/impl_tag.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// Basic usage:
1212
///
1313
/// ```
14-
/// #![feature(macro_metavar_expr)]
14+
/// #![cfg_attr(bootstrap, feature(macro_metavar_expr))]
1515
/// use rustc_data_structures::{impl_tag, tagged_ptr::Tag};
1616
///
1717
/// #[derive(Copy, Clone, PartialEq, Debug)]
@@ -51,7 +51,7 @@
5151
/// Structs are supported:
5252
///
5353
/// ```
54-
/// #![feature(macro_metavar_expr)]
54+
/// #![cfg_attr(bootstrap, feature(macro_metavar_expr))]
5555
/// # use rustc_data_structures::impl_tag;
5656
/// #[derive(Copy, Clone)]
5757
/// struct Flags { a: bool, b: bool }
@@ -68,7 +68,7 @@
6868
/// Not specifying all values results in a compile error:
6969
///
7070
/// ```compile_fail,E0004
71-
/// #![feature(macro_metavar_expr)]
71+
/// #![cfg_attr(bootstrap, feature(macro_metavar_expr))]
7272
/// # use rustc_data_structures::impl_tag;
7373
/// #[derive(Copy, Clone)]
7474
/// enum E {

compiler/rustc_expand/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(if_let_guard)]
77
#![feature(let_chains)]
88
#![feature(lint_reasons)]
9-
#![feature(macro_metavar_expr)]
9+
#![cfg_attr(bootstrap, feature(macro_metavar_expr))]
1010
#![feature(map_try_insert)]
1111
#![feature(proc_macro_diagnostic)]
1212
#![feature(proc_macro_internals)]

compiler/rustc_expand/src/mbe/quoted.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,6 @@ fn parse_tree<'a>(
183183
return TokenTree::token(token::Dollar, span);
184184
}
185185
Ok(elem) => {
186-
maybe_emit_macro_metavar_expr_feature(
187-
features,
188-
sess,
189-
delim_span.entire(),
190-
);
191186
return TokenTree::MetaVarExpr(delim_span, elem);
192187
}
193188
}

compiler/rustc_metadata/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![feature(let_chains)]
1212
#![feature(if_let_guard)]
1313
#![feature(proc_macro_internals)]
14-
#![feature(macro_metavar_expr)]
14+
#![cfg_attr(bootstrap, feature(macro_metavar_expr))]
1515
#![feature(min_specialization)]
1616
#![feature(trusted_len)]
1717
#![feature(try_blocks)]

compiler/rustc_middle/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#![feature(yeet_expr)]
6060
#![feature(const_option)]
6161
#![feature(ptr_alignment_type)]
62-
#![feature(macro_metavar_expr)]
62+
#![cfg_attr(bootstrap, feature(macro_metavar_expr))]
6363
#![allow(internal_features)]
6464
#![allow(rustc::potential_query_instability)]
6565
#![allow(rustc::diagnostic_outside_of_impl)]

library/core/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@
204204
//
205205
// Language features:
206206
// tidy-alphabetical-start
207+
#![cfg_attr(bootstrap, feature(macro_metavar_expr))]
207208
#![feature(abi_unadjusted)]
208209
#![feature(adt_const_params)]
209210
#![feature(allow_internal_unsafe)]
@@ -238,7 +239,6 @@
238239
#![feature(lang_items)]
239240
#![feature(let_chains)]
240241
#![feature(link_llvm_intrinsics)]
241-
#![feature(macro_metavar_expr)]
242242
#![feature(min_exhaustive_patterns)]
243243
#![feature(min_specialization)]
244244
#![feature(multiple_supertrait_upcastable)]

src/tools/tidy/src/ui_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ENTRY_LIMIT: usize = 900;
1818
// FIXME: The following limits should be reduced eventually.
1919

2020
const ISSUES_ENTRY_LIMIT: usize = 1750;
21-
const ROOT_ENTRY_LIMIT: usize = 859;
21+
const ROOT_ENTRY_LIMIT: usize = 860;
2222

2323
const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
2424
"rs", // test source files

tests/ui/macros/meta-variable-depth-outside-repeat.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(macro_metavar_expr)]
2-
31
macro_rules! metavar {
42
( $i:expr ) => {
53
${length(0)}

tests/ui/macros/meta-variable-depth-outside-repeat.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: meta-variable expression `length` with depth parameter must be called inside of a macro repetition
2-
--> $DIR/meta-variable-depth-outside-repeat.rs:5:10
2+
--> $DIR/meta-variable-depth-outside-repeat.rs:3:10
33
|
44
LL | ${length(0)}
55
| ^^^^^^^^^^^

0 commit comments

Comments
 (0)