We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 737d473 commit 323c283Copy full SHA for 323c283
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
@@ -2575,9 +2575,9 @@ impl<'o, 'tcx> dyn HirTyLowerer<'tcx> + 'o {
2575
2576
pub fn lower_arg_ty(&self, ty: &hir::Ty<'tcx>, expected_ty: Option<Ty<'tcx>>) -> Ty<'tcx> {
2577
match ty.kind {
2578
- hir::TyKind::Infer if expected_ty.is_some() => {
2579
- self.record_ty(ty.hir_id, expected_ty.unwrap(), ty.span);
2580
- expected_ty.unwrap()
+ hir::TyKind::Infer if let Some(expected_ty) = expected_ty => {
+ self.record_ty(ty.hir_id, expected_ty, ty.span);
+ expected_ty
2581
}
2582
_ => self.lower_ty(ty),
2583
0 commit comments