Skip to content

Commit f8aff87

Browse files
committed
revert let pattern check
1 parent b30f3df commit f8aff87

3 files changed

Lines changed: 0 additions & 130 deletions

File tree

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -903,16 +903,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
903903

904904
// Type check the pattern. Override if necessary to avoid knock-on errors.
905905
self.check_pat_top(decl.pat, decl_ty, ty_span, origin_expr, Some(decl.origin));
906-
if decl.ty.is_none()
907-
&& decl.init.is_none()
908-
&& !matches!(decl.pat.kind, hir::PatKind::Binding(.., None) | hir::PatKind::Wild)
909-
{
910-
self.register_wf_obligation(
911-
decl_ty.into(),
912-
decl.pat.span,
913-
ObligationCauseCode::WellFormed(None),
914-
);
915-
}
916906
let pat_ty = self.node_ty(decl.pat.hir_id);
917907
self.overwrite_local_ty_if_err(decl.hir_id, decl.pat, pat_ty);
918908

tests/ui/wf/let-pat-inferred-non-wf.rs

Lines changed: 0 additions & 58 deletions
This file was deleted.

tests/ui/wf/let-pat-inferred-non-wf.stderr

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)