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`.
This commit is contained in:
Esteban Kuber 2021-09-02 18:34:03 +00:00
parent a603756cc5
commit 48b8e4577a

View file

@ -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,