Skip to content

Commit

Permalink
Detect bare blocks with type ascription that were meant to be a `stru…
Browse files Browse the repository at this point in the history
…ct` literal

Address part of rust-lang#34255.

Potential improvement: silence the other knock down errors in
`issue-34255-1.rs`.
  • Loading branch information
estebank committed Sep 3, 2021
1 parent a603756 commit 48b8e45
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/closures.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 48b8e45

Please sign in to comment.