Skip to content

Commit 48b8e45

Browse files
committed
Detect bare blocks with type ascription that were meant to be a struct literal
Address part of rust-lang#34255. Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
1 parent a603756 commit 48b8e45

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/closures.rs

+1
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ fn rewrite_closure_with_block(
160160
.first()
161161
.map(|attr| attr.span.to(body.span))
162162
.unwrap_or(body.span),
163+
could_be_bare_literal: false,
163164
};
164165
let block = crate::expr::rewrite_block_with_visitor(
165166
context,

0 commit comments

Comments
 (0)