Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8c39296

Browse files
committedMar 1, 2025
Auto merge of rust-lang#137848 - matthiaskrgr:rollup-vxtrkis, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#136503 (Tweak output of const panic diagnostic) - rust-lang#137390 (tests: fix up new test for nocapture -> capture(none) change) - rust-lang#137617 (Introduce `feature(generic_const_parameter_types)`) - rust-lang#137719 (Add missing case explanation for doc inlined re-export of doc hidden item) - rust-lang#137763 (Use `mk_ty_from_kind` a bit less, clean up lifetime handling in borrowck) - rust-lang#137769 (Do not yeet `unsafe<>` from type when formatting unsafe binder) - rust-lang#137776 (Some `rustc_transmute` cleanups) - rust-lang#137800 (Remove `ParamEnv::without_caller_bounds`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0c72c0d + c03756a commit 8c39296

File tree

206 files changed

+996
-1002
lines changed

Some content is hidden

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

206 files changed

+996
-1002
lines changed
 

‎compiler/rustc_hir_analysis/src/collect.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1822,6 +1822,9 @@ fn const_param_default<'tcx>(
18221822
),
18231823
};
18241824
let icx = ItemCtxt::new(tcx, def_id);
1825-
let ct = icx.lowerer().lower_const_arg(default_ct, FeedConstTy::Param(def_id.to_def_id()));
1825+
let identity_args = ty::GenericArgs::identity_for_item(tcx, def_id);
1826+
let ct = icx
1827+
.lowerer()
1828+
.lower_const_arg(default_ct, FeedConstTy::Param(def_id.to_def_id(), identity_args));
18261829
ty::EarlyBinder::bind(ct)
18271830
}

‎compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Gen
223223
}
224224
hir::GenericParamKind::Const { .. } => {
225225
let param_def_id = param.def_id.to_def_id();
226-
let ct_ty = tcx
227-
.type_of(param_def_id)
228-
.no_bound_vars()
229-
.expect("const parameters cannot be generic");
226+
let ct_ty = tcx.type_of(param_def_id).instantiate_identity();
230227
let ct = icx.lowerer().lower_const_param(param_def_id, param.hir_id);
231228
predicates
232229
.insert((ty::ClauseKind::ConstArgHasType(ct, ct_ty).upcast(tcx), param.span));

‎compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pub fn lower_generic_args<'tcx: 'a, 'a>(
273273

274274
// We lower to an infer even when the feature gate is not enabled
275275
// as it is useful for diagnostics to be able to see a `ConstKind::Infer`
276-
args.push(ctx.provided_kind(param, arg));
276+
args.push(ctx.provided_kind(&args, param, arg));
277277
args_iter.next();
278278
params.next();
279279
}
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.