From 5b44b3cb1b2bc2f93520fe1339d93efe8439238c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 20 Jan 2019 09:11:42 -0800 Subject: [PATCH] review comment --- src/librustc_typeck/check/demand.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_typeck/check/demand.rs b/src/librustc_typeck/check/demand.rs index 2aecc0f2ace..d985bdae491 100644 --- a/src/librustc_typeck/check/demand.rs +++ b/src/librustc_typeck/check/demand.rs @@ -495,7 +495,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { })) = self.tcx.hir().find(self.tcx.hir().get_parent_node(expr.id)) { // `expr` is a literal field for a struct, only suggest if appropriate for field in fields { - if field.expr.id == expr.id { + if field.expr.id == expr.id && field.is_shorthand { // This is a field literal prefix = format!("{}: ", field.ident); break;