Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/lower.rs')
-rw-r--r--crates/hir-ty/src/lower.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/crates/hir-ty/src/lower.rs b/crates/hir-ty/src/lower.rs
index a07063ba60..2d43fffa6a 100644
--- a/crates/hir-ty/src/lower.rs
+++ b/crates/hir-ty/src/lower.rs
@@ -1192,11 +1192,7 @@ impl<'a> TyLoweringContext<'a> {
return None;
}
- if bounds.first().and_then(|b| b.trait_id()).is_none() {
- // When there's no trait bound, that's an error. This happens when the trait refs
- // are unresolved.
- return None;
- }
+ bounds.first().and_then(|b| b.trait_id())?;
// As multiple occurrences of the same auto traits *are* permitted, we deduplicate the
// bounds. We shouldn't have repeated elements besides auto traits at this point.
@@ -1241,7 +1237,7 @@ impl<'a> TyLoweringContext<'a> {
});
crate::wrap_empty_binders(clause)
});
- predicates.extend(sized_clause.into_iter());
+ predicates.extend(sized_clause);
predicates.shrink_to_fit();
}
predicates