Skip to content

Commit dd8098e

Browse files
committed
ensure type infer args have their type recorded
1 parent 3fdbfb1 commit dd8098e

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,17 +1294,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12941294
.lower_lifetime(lt, RegionInferReason::Param(param))
12951295
.into(),
12961296
(GenericParamDefKind::Type { .. }, GenericArg::Type(ty)) => {
1297-
// We handle the ambig portions of `Ty` in match arms below
1297+
// We handle the ambig portions of `Ty` in match arm below
12981298
self.fcx.lower_ty(ty.as_unambig_ty()).raw.into()
12991299
}
1300+
(GenericParamDefKind::Type { .. }, GenericArg::Infer(inf)) => {
1301+
self.fcx.lower_ty(&inf.to_ty()).raw.into()
1302+
}
13001303
(GenericParamDefKind::Const { .. }, GenericArg::Const(ct)) => self
13011304
.fcx
13021305
// Ambiguous parts of `ConstArg` are handled in the match arms below
13031306
.lower_const_arg(ct.as_unambig_ct(), FeedConstTy::Param(param.def_id))
13041307
.into(),
1305-
(GenericParamDefKind::Type { .. }, GenericArg::Infer(inf)) => {
1306-
self.fcx.ty_infer(Some(param), inf.span).into()
1307-
}
13081308
(&GenericParamDefKind::Const { .. }, GenericArg::Infer(inf)) => {
13091309
self.fcx.ct_infer(Some(param), inf.span).into()
13101310
}

compiler/rustc_hir_typeck/src/method/confirm.rs

Lines changed: 3 additions & 3 deletions
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)