Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
| -rw-r--r-- | crates/hir/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index b4388ad965..cf6297c037 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -1418,7 +1418,8 @@ impl Adt { } pub fn layout(self, db: &dyn HirDatabase) -> Result<Layout, LayoutError> { - if db.generic_params(self.into()).iter().count() != 0 { + let generic_params = &db.generic_params(self.into()); + if generic_params.iter().next().is_some() || generic_params.iter_lt().next().is_some() { return Err(LayoutError::HasPlaceholder); } let krate = self.krate(db).id; |