Skip to content

Commit f8fe978

Browse files
committed
remove unnecessary loop
1 parent a7fc463 commit f8fe978

File tree

1 file changed

+1
-7
lines changed
  • compiler/rustc_hir_analysis/src/collect/type_of

1 file changed

+1
-7
lines changed

Diff for: compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -371,14 +371,8 @@ impl RpitConstraintChecker<'_> {
371371
// Use borrowck to get the type with unerased regions.
372372
let concrete_opaque_types = &self.tcx.mir_borrowck(def_id).concrete_opaque_types;
373373
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-
374+
if let Some(&concrete_type) = concrete_opaque_types.get(&self.def_id) {
380375
debug!(?concrete_type, "found constraint");
381-
382376
if concrete_type.ty != self.found.ty {
383377
if let Ok(d) = self.found.build_mismatch_error(&concrete_type, self.tcx) {
384378
d.emit();

0 commit comments

Comments
 (0)