Skip to content

Commit e79ccc4

Browse files
authored
Rollup merge of rust-lang#119891 - lcnr:rename-field, r=compiler-errors
rename `reported_signature_mismatch` to reflect its use it's used for a lot of things, not only closures
2 parents 7b507db + 7fe0cd6 commit e79ccc4

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

compiler/rustc_infer/src/infer/at.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<'tcx> InferCtxt<'tcx> {
8484
selection_cache: self.selection_cache.clone(),
8585
evaluation_cache: self.evaluation_cache.clone(),
8686
reported_trait_errors: self.reported_trait_errors.clone(),
87-
reported_closure_mismatch: self.reported_closure_mismatch.clone(),
87+
reported_signature_mismatch: self.reported_signature_mismatch.clone(),
8888
tainted_by_errors: self.tainted_by_errors.clone(),
8989
err_count_on_creation: self.err_count_on_creation,
9090
universe: self.universe.clone(),

compiler/rustc_infer/src/infer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub struct InferCtxt<'tcx> {
278278
/// avoid reporting the same error twice.
279279
pub reported_trait_errors: RefCell<FxIndexMap<Span, Vec<ty::Predicate<'tcx>>>>,
280280

281-
pub reported_closure_mismatch: RefCell<FxHashSet<(Span, Option<Span>)>>,
281+
pub reported_signature_mismatch: RefCell<FxHashSet<(Span, Option<Span>)>>,
282282

283283
/// When an error occurs, we want to avoid reporting "derived"
284284
/// errors that are due to this original failure. Normally, we
@@ -702,7 +702,7 @@ impl<'tcx> InferCtxtBuilder<'tcx> {
702702
selection_cache: Default::default(),
703703
evaluation_cache: Default::default(),
704704
reported_trait_errors: Default::default(),
705-
reported_closure_mismatch: Default::default(),
705+
reported_signature_mismatch: Default::default(),
706706
tainted_by_errors: Cell::new(None),
707707
err_count_on_creation: tcx.dcx().err_count(),
708708
universe: Cell::new(ty::UniverseIndex::ROOT),

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -3459,14 +3459,12 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
34593459
let found_node = found_did.and_then(|did| self.tcx.hir().get_if_local(did));
34603460
let found_span = found_did.and_then(|did| self.tcx.hir().span_if_local(did));
34613461

3462-
if self.reported_closure_mismatch.borrow().contains(&(span, found_span)) {
3462+
if !self.reported_signature_mismatch.borrow_mut().insert((span, found_span)) {
34633463
// We check closures twice, with obligations flowing in different directions,
34643464
// but we want to complain about them only once.
34653465
return None;
34663466
}
34673467

3468-
self.reported_closure_mismatch.borrow_mut().insert((span, found_span));
3469-
34703468
let mut not_tupled = false;
34713469

34723470
let found = match found_trait_ref.skip_binder().args.type_at(1).kind() {

0 commit comments

Comments
 (0)