remove unnecessary loop

This commit is contained in:
lcnr 2025-03-19 17:32:21 +01:00
parent a7fc463dd8
commit f8fe978fab

View File

@ -371,14 +371,8 @@ impl RpitConstraintChecker<'_> {
// Use borrowck to get the type with unerased regions.
let concrete_opaque_types = &self.tcx.mir_borrowck(def_id).concrete_opaque_types;
debug!(?concrete_opaque_types);
for (&def_id, &concrete_type) in concrete_opaque_types {
if def_id != self.def_id {
// Ignore constraints for other opaque types.
continue;
}
if let Some(&concrete_type) = concrete_opaque_types.get(&self.def_id) {
debug!(?concrete_type, "found constraint");
if concrete_type.ty != self.found.ty {
if let Ok(d) = self.found.build_mismatch_error(&concrete_type, self.tcx) {
d.emit();