diff options
| author | Esteban Kuber <esteban@kuber.com.ar> | 2021-09-02 18:34:03 +0000 |
|---|---|---|
| committer | Esteban Kuber <esteban@kuber.com.ar> | 2021-09-03 14:43:04 +0000 |
| commit | 48b8e4577a6fefc032b97712872eff5a87b27fd7 (patch) | |
| tree | 7d26d11d6e638181caa3fb6f33add16ba702e441 | |
| parent | a603756cc5855c78fb261d18203128fb54f3c22a (diff) | |
| download | rust-48b8e4577a6fefc032b97712872eff5a87b27fd7.tar.gz rust-48b8e4577a6fefc032b97712872eff5a87b27fd7.zip | |
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`.
| -rw-r--r-- | src/closures.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/closures.rs b/src/closures.rs index c9d46aef294..34d73a77fd3 100644 --- a/src/closures.rs +++ b/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, |
