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 | 12ce6e9c60c662dc7181b70021145f191c0f9f3e (patch) | |
| tree | 2d25c254eeec0782df8dced3f020e4cff9ef6785 /compiler/rustc_builtin_macros | |
| parent | fcce644119cf4e8e36001368e514bb5ed67cb855 (diff) | |
| download | rust-12ce6e9c60c662dc7181b70021145f191c0f9f3e.tar.gz rust-12ce6e9c60c662dc7181b70021145f191c0f9f3e.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`.
Diffstat (limited to 'compiler/rustc_builtin_macros')
| -rw-r--r-- | compiler/rustc_builtin_macros/src/deriving/mod.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_builtin_macros/src/format.rs | 1 | 
2 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_builtin_macros/src/deriving/mod.rs b/compiler/rustc_builtin_macros/src/deriving/mod.rs index 572ec6e242e..bcf95719db5 100644 --- a/compiler/rustc_builtin_macros/src/deriving/mod.rs +++ b/compiler/rustc_builtin_macros/src/deriving/mod.rs @@ -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, })) } diff --git a/compiler/rustc_builtin_macros/src/format.rs b/compiler/rustc_builtin_macros/src/format.rs index 1dbf7728421..8508b3b7ae6 100644 --- a/compiler/rustc_builtin_macros/src/format.rs +++ b/compiler/rustc_builtin_macros/src/format.rs @@ -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);  | 
