about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-09-04 01:40:36 +0000
committerbors <bors@rust-lang.org>2021-09-04 01:40:36 +0000
commitb4e8596e3e78395543747ebaba26b49f6a478aa8 (patch)
treec782e430605f5b820e4c4aaa448493bf706eccd2 /src/tools
parent03c775c95596cbd92f2b1e8ca98e7addfa3eade2 (diff)
parent12ce6e9c60c662dc7181b70021145f191c0f9f3e (diff)
downloadrust-b4e8596e3e78395543747ebaba26b49f6a478aa8.tar.gz
rust-b4e8596e3e78395543747ebaba26b49f6a478aa8.zip
Auto merge of #88598 - estebank:type-ascription-can-die-in-a-fire, r=wesleywiser
Detect bare blocks with type ascription that were meant to be a `struct` literal

Address part of #34255.

Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/rustfmt/src/closures.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/tools/rustfmt/src/closures.rs b/src/tools/rustfmt/src/closures.rs
index c9d46aef294..34d73a77fd3 100644
--- a/src/tools/rustfmt/src/closures.rs
+++ b/src/tools/rustfmt/src/closures.rs
@@ -160,6 +160,7 @@ fn rewrite_closure_with_block(
             .first()
             .map(|attr| attr.span.to(body.span))
             .unwrap_or(body.span),
+        could_be_bare_literal: false,
     };
     let block = crate::expr::rewrite_block_with_visitor(
         context,