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`.
This commit is contained in:
bors 2021-09-04 01:40:36 +00:00
commit b4e8596e3e
13 changed files with 67 additions and 5 deletions

View file

@ -102,6 +102,7 @@ fn call_unreachable(cx: &ExtCtxt<'_>, span: Span) -> P<ast::Expr> {
rules: ast::BlockCheckMode::Unsafe(ast::CompilerGenerated),
span,
tokens: None,
could_be_bare_literal: false,
}))
}

View file

@ -867,6 +867,7 @@ impl<'a, 'b> Context<'a, 'b> {
rules: BlockCheckMode::Unsafe(UnsafeSource::CompilerGenerated),
span: self.macsp,
tokens: None,
could_be_bare_literal: false,
}));
let ident = Ident::from_str_and_span("args", self.macsp);