Skip to content

Commit 92d4690

Browse files
committed
ensure type infer args have their type recorded
1 parent 05aed6c commit 92d4690

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1285,17 +1285,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12851285
.lower_lifetime(lt, RegionInferReason::Param(param))
12861286
.into(),
12871287
(GenericParamDefKind::Type { .. }, GenericArg::Type(ty)) => {
1288-
// We handle the ambig portions of `Ty` in match arms below
1288+
// We handle the ambig portions of `Ty` in match arm below
12891289
self.fcx.lower_ty(ty.as_unambig_ty()).raw.into()
12901290
}
1291+
(GenericParamDefKind::Type { .. }, GenericArg::Infer(inf)) => {
1292+
self.fcx.lower_ty(&inf.to_ty()).raw.into()
1293+
}
12911294
(GenericParamDefKind::Const { .. }, GenericArg::Const(ct)) => self
12921295
.fcx
12931296
// Ambiguous parts of `ConstArg` are handled in the match arms below
12941297
.lower_const_arg(ct.as_unambig_ct(), FeedConstTy::Param(param.def_id))
12951298
.into(),
1296-
(GenericParamDefKind::Type { .. }, GenericArg::Infer(inf)) => {
1297-
self.fcx.ty_infer(Some(param), inf.span).into()
1298-
}
12991299
(&GenericParamDefKind::Const { .. }, GenericArg::Infer(inf)) => {
13001300
self.fcx.ct_infer(Some(param), inf.span).into()
13011301
}

compiler/rustc_hir_typeck/src/method/confirm.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -428,14 +428,14 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
428428
// We handle the ambig portions of `Ty` in the match arms below
429429
self.cfcx.lower_ty(ty.as_unambig_ty()).raw.into()
430430
}
431+
(GenericParamDefKind::Type { .. }, GenericArg::Infer(inf)) => {
432+
self.cfcx.lower_ty(&inf.to_ty()).raw.into()
433+
}
431434
(GenericParamDefKind::Const { .. }, GenericArg::Const(ct)) => self
432435
.cfcx
433436
// We handle the ambig portions of `ConstArg` in the match arms below
434437
.lower_const_arg(ct.as_unambig_ct(), FeedConstTy::Param(param.def_id))
435438
.into(),
436-
(GenericParamDefKind::Type { .. }, GenericArg::Infer(inf)) => {
437-
self.cfcx.ty_infer(Some(param), inf.span).into()
438-
}
439439
(GenericParamDefKind::Const { .. }, GenericArg::Infer(inf)) => {
440440
self.cfcx.ct_infer(Some(param), inf.span).into()
441441
}

0 commit comments

Comments
 (0)