]> git.proxmox.com Git - rustc.git/blobdiff - compiler/rustc_trait_selection/src/autoderef.rs
New upstream version 1.58.1+dfsg1
[rustc.git] / compiler / rustc_trait_selection / src / autoderef.rs
index 53afe4ca068c4cf24f0601ee3c38ddb7a8cbc855..4c80483fc1f1e7750b5c3e68200c75ccb6a6ec23 100644 (file)
@@ -152,11 +152,12 @@ impl<'a, 'tcx> Autoderef<'a, 'tcx> {
             },
             cause,
         );
-        if let Err(e) = fulfillcx.select_where_possible(&self.infcx) {
+        let errors = fulfillcx.select_where_possible(&self.infcx);
+        if !errors.is_empty() {
             // This shouldn't happen, except for evaluate/fulfill mismatches,
             // but that's not a reason for an ICE (`predicate_may_hold` is conservative
             // by design).
-            debug!("overloaded_deref_ty: encountered errors {:?} while fulfilling", e);
+            debug!("overloaded_deref_ty: encountered errors {:?} while fulfilling", errors);
             return None;
         }
         let obligations = fulfillcx.pending_obligations();