about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crates/hir/src/display.rs2
-rw-r--r--crates/ide/src/hover/tests.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs
index 0fa2d803467..23c6b078b96 100644
--- a/crates/hir/src/display.rs
+++ b/crates/hir/src/display.rs
@@ -185,8 +185,8 @@ impl HirDisplay for Struct {
                 write_where_clause(def_id, f)?;
             }
             StructKind::Record => {
+                let has_where_clause = write_where_clause(def_id, f)?;
                 if let Some(limit) = f.entity_limit {
-                    let has_where_clause = write_where_clause(def_id, f)?;
                     let fields = self.fields(f.db);
                     let count = fields.len().min(limit);
                     f.write_char(if !has_where_clause { ' ' } else { '\n' })?;
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs
index 289c2ad945d..463f0951eaf 100644
--- a/crates/ide/src/hover/tests.rs
+++ b/crates/ide/src/hover/tests.rs
@@ -872,6 +872,8 @@ struct Foo$0 where u32: Copy { field: u32 }
             ```rust
             // size = 4, align = 4
             struct Foo
+            where
+                u32: Copy,
             ```
         "#]],
     );