Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/expr_store/pretty.rs')
-rw-r--r--crates/hir-def/src/expr_store/pretty.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/crates/hir-def/src/expr_store/pretty.rs b/crates/hir-def/src/expr_store/pretty.rs
index 9a8a8c2cd0..1b3a1bb4dc 100644
--- a/crates/hir-def/src/expr_store/pretty.rs
+++ b/crates/hir-def/src/expr_store/pretty.rs
@@ -8,7 +8,7 @@ use span::Edition;
use crate::{
hir::{
Array, BindingAnnotation, CaptureBy, ClosureKind, Literal, LiteralOrConst, Movability,
- Statement,
+ Spread, Statement,
},
pretty::{print_generic_args, print_path, print_type_ref},
VariantId,
@@ -398,7 +398,7 @@ impl Printer<'_> {
self.print_expr(*expr);
}
}
- Expr::RecordLit { path, fields, spread, ellipsis: _ } => {
+ Expr::RecordLit { path, fields, spread } => {
match path {
Some(path) => self.print_path(path),
None => w!(self, "�"),
@@ -412,10 +412,16 @@ impl Printer<'_> {
p.print_expr(field.expr);
wln!(p, ",");
}
- if let Some(spread) = spread {
- w!(p, "..");
- p.print_expr(*spread);
- wln!(p);
+ match spread {
+ Spread::No => {}
+ Spread::Yes => {
+ w!(p, "..");
+ }
+ Spread::Base(expr) => {
+ w!(p, "..");
+ p.print_expr(*expr);
+ wln!(p);
+ }
}
});
w!(self, "}}");