Skip to content

Commit 50b4300

Browse files
authored
Unrolled build for rust-lang#125314
Rollup merge of rust-lang#125314 - jdonszelmann:global-registration-feature-gate, r=pnkfelix Add an experimental feature gate for global registration See rust-lang#125119 for the tracking issue.
2 parents 474bee7 + a2e0f10 commit 50b4300

File tree

5 files changed

+20
-0
lines changed

5 files changed

+20
-0
lines changed

compiler/rustc_ast_passes/src/feature_gate.rs

+1
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

+2
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ declare_features! (
489489
(incomplete, generic_const_exprs, "1.56.0", Some(76560)),
490490
/// Allows generic parameters and where-clauses on free & associated const items.
491491
(incomplete, generic_const_items, "1.73.0", Some(113521)),
492+
/// Allows registering static items globally, possibly across crates, to iterate over at runtime.
493+
(unstable, global_registration, "CURRENT_RUSTC_VERSION", Some(125119)),
492494
/// Allows using `..=X` as a patterns in slices.
493495
(unstable, half_open_range_patterns_in_slices, "1.66.0", Some(67264)),
494496
/// Allows `if let` guard in match arms.

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ symbols! {
930930
global_alloc_ty,
931931
global_allocator,
932932
global_asm,
933+
global_registration,
933934
globs,
934935
gt,
935936
half_open_range_patterns,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
todo!(); //~ ERROR
2+
3+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
error: expected one of `!` or `::`, found `(`
2+
--> $DIR/feature-gate-global-registration.rs:1:1
3+
|
4+
LL | todo!();
5+
| ^^^^^^^
6+
| |
7+
| expected one of `!` or `::`
8+
| in this macro invocation
9+
|
10+
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
11+
12+
error: aborting due to 1 previous error
13+

0 commit comments

Comments
 (0)