about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorlcnr <rust@lcnr.de>2024-01-12 16:07:20 +0100
committerlcnr <rust@lcnr.de>2024-01-12 16:21:04 +0100
commit7fe0cd6d3b1f7bdbdcf25d8a5d90582f577d63d4 (patch)
treee6da46910bc1178e1f849ad814a45b87ec5d22ad /compiler/rustc_trait_selection
parent5431404b87967c69438ea1e698edbe96505f0798 (diff)
downloadrust-7fe0cd6d3b1f7bdbdcf25d8a5d90582f577d63d4.tar.gz
rust-7fe0cd6d3b1f7bdbdcf25d8a5d90582f577d63d4.zip
rename `reported_signature_mismatch` to reflect its use
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
index 47a700805fa..a9fd538b6c0 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
@@ -3459,14 +3459,12 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
         let found_node = found_did.and_then(|did| self.tcx.hir().get_if_local(did));
         let found_span = found_did.and_then(|did| self.tcx.hir().span_if_local(did));
 
-        if self.reported_closure_mismatch.borrow().contains(&(span, found_span)) {
+        if !self.reported_signature_mismatch.borrow_mut().insert((span, found_span)) {
             // We check closures twice, with obligations flowing in different directions,
             // but we want to complain about them only once.
             return None;
         }
 
-        self.reported_closure_mismatch.borrow_mut().insert((span, found_span));
-
         let mut not_tupled = false;
 
         let found = match found_trait_ref.skip_binder().args.type_at(1).kind() {