Skip to content

Commit 42119ff

Browse files
committed
create a feature gate
1 parent c45e831 commit 42119ff

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
560560
gate_all!(postfix_match, "postfix match is experimental");
561561
gate_all!(mut_ref, "mutable by-reference bindings are experimental");
562562
gate_all!(precise_capturing, "precise captures on `impl Trait` are experimental");
563+
gate_all!(global_registration, "global registration is experimental");
563564

564565
if !visitor.features.never_patterns {
565566
if let Some(spans) = spans.get(&sym::never_patterns) {

compiler/rustc_feature/src/unstable.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,8 @@ declare_features! (
487487
(incomplete, generic_const_exprs, "1.56.0", Some(76560)),
488488
/// Allows generic parameters and where-clauses on free & associated const items.
489489
(incomplete, generic_const_items, "1.73.0", Some(113521)),
490+
/// Allows registring static items globally, possibly across crates, to iterate over at runtime.
491+
(unstable, global_registration, "CURRENT_RUSTC_VERSION", Some(125119)),
490492
/// Allows using `..=X` as a patterns in slices.
491493
(unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)),
492494
/// Allows `if let` guard in match arms.

compiler/rustc_span/src/symbol.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -928,6 +928,7 @@ symbols! {
928928
global_alloc_ty,
929929
global_allocator,
930930
global_asm,
931+
global_registration,
931932
globs,
932933
gt,
933934
half_open_range_patterns,
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//! WIP

0 commit comments

Comments
 (0)