Skip to content

Commit c655d4b

Browse files
Don't create an extra infcx in report_closure_arg_mismatch
1 parent 7480389 commit c655d4b

File tree

1 file changed

+1
-3
lines changed
  • compiler/rustc_trait_selection/src/traits/error_reporting

1 file changed

+1
-3
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use rustc_hir::def_id::DefId;
2020
use rustc_hir::intravisit::Visitor;
2121
use rustc_hir::lang_items::LangItem;
2222
use rustc_hir::{AsyncGeneratorKind, GeneratorKind, Node};
23-
use rustc_infer::infer::TyCtxtInferExt;
2423
use rustc_middle::hir::map;
2524
use rustc_middle::ty::{
2625
self, suggest_arbitrary_trait_bound, suggest_constraining_type_param, AdtKind, DefIdTree,
@@ -1633,8 +1632,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
16331632
let expected = build_fn_sig_ty(self.tcx, expected);
16341633
let found = build_fn_sig_ty(self.tcx, found);
16351634

1636-
let (expected_str, found_str) =
1637-
self.tcx.infer_ctxt().enter(|infcx| infcx.cmp(expected, found));
1635+
let (expected_str, found_str) = self.cmp(expected, found);
16381636

16391637
let signature_kind = format!("{argument_kind} signature");
16401638
err.note_expected_found(&signature_kind, expected_str, &signature_kind, found_str);

0 commit comments

Comments
 (0)