Skip to content

Commit 362de31

Browse files
committedFeb 26, 2025
Introduce feature(generic_const_parameter_types)
1 parent ad27045 commit 362de31

File tree

57 files changed

+456
-155
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+456
-155
lines changed
 

‎compiler/rustc_feature/src/unstable.rs

+2
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ declare_features! (
508508
(incomplete, generic_const_exprs, "1.56.0", Some(76560)),
509509
/// Allows generic parameters and where-clauses on free & associated const items.
510510
(incomplete, generic_const_items, "1.73.0", Some(113521)),
511+
/// Allows the type of const generics to depend on generic parameters
512+
(incomplete, generic_const_parameter_types, "CURRENT_RUSTC_VERSION", Some(137626)),
511513
/// Allows any generic constants being used as pattern type range ends
512514
(incomplete, generic_pattern_types, "1.86.0", Some(136574)),
513515
/// Allows registering static items globally, possibly across crates, to iterate over at runtime.

‎compiler/rustc_hir_analysis/src/check/wfcheck.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) -> Result<(),
966966
let ty = tcx.type_of(param.def_id).instantiate_identity();
967967

968968
if tcx.features().unsized_const_params() {
969-
enter_wf_checking_ctxt(tcx, hir_ty.span, param.def_id, |wfcx| {
969+
enter_wf_checking_ctxt(tcx, hir_ty.span, tcx.local_parent(param.def_id), |wfcx| {
970970
wfcx.register_bound(
971971
ObligationCause::new(
972972
hir_ty.span,
@@ -980,7 +980,7 @@ fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) -> Result<(),
980980
Ok(())
981981
})
982982
} else if tcx.features().adt_const_params() {
983-
enter_wf_checking_ctxt(tcx, hir_ty.span, param.def_id, |wfcx| {
983+
enter_wf_checking_ctxt(tcx, hir_ty.span, tcx.local_parent(param.def_id), |wfcx| {
984984
wfcx.register_bound(
985985
ObligationCause::new(
986986
hir_ty.span,

0 commit comments

Comments
 (0)