We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7fc463 commit f8fe978Copy full SHA for f8fe978
compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs
@@ -371,14 +371,8 @@ impl RpitConstraintChecker<'_> {
371
// Use borrowck to get the type with unerased regions.
372
let concrete_opaque_types = &self.tcx.mir_borrowck(def_id).concrete_opaque_types;
373
debug!(?concrete_opaque_types);
374
- for (&def_id, &concrete_type) in concrete_opaque_types {
375
- if def_id != self.def_id {
376
- // Ignore constraints for other opaque types.
377
- continue;
378
- }
379
-
+ if let Some(&concrete_type) = concrete_opaque_types.get(&self.def_id) {
380
debug!(?concrete_type, "found constraint");
381
382
if concrete_type.ty != self.found.ty {
383
if let Ok(d) = self.found.build_mismatch_error(&concrete_type, self.tcx) {
384
d.emit();
0 commit comments