Skip to content

Commit 5b44b3c

Browse files
committed
review comment
1 parent b36bf76 commit 5b44b3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_typeck/check/demand.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
495495
})) = self.tcx.hir().find(self.tcx.hir().get_parent_node(expr.id)) {
496496
// `expr` is a literal field for a struct, only suggest if appropriate
497497
for field in fields {
498-
if field.expr.id == expr.id {
498+
if field.expr.id == expr.id && field.is_shorthand {
499499
// This is a field literal
500500
prefix = format!("{}: ", field.ident);
501501
break;

0 commit comments

Comments
 (0)