diff options
| author | lcnr <rust@lcnr.de> | 2025-03-19 17:32:21 +0100 |
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2025-03-19 17:32:21 +0100 |
| commit | f8fe978fab83d6cdb7ccd148a7e2bd5c9caae156 (patch) | |
| tree | d62e4cfe84c1a8170bf9f0185034391fefbd0189 | |
| parent | a7fc463dd8fbeca800d4b3efc501069502cffe64 (diff) | |
| download | rust-f8fe978fab83d6cdb7ccd148a7e2bd5c9caae156.tar.gz rust-f8fe978fab83d6cdb7ccd148a7e2bd5c9caae156.zip | |
remove unnecessary loop
| -rw-r--r-- | compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs index 142078900f0..075dc590b99 100644 --- a/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs +++ b/compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs @@ -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(); |
