diff options
Diffstat (limited to 'compiler/rustc_ast/src')
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_ast/src/mut_visit.rs | 2 | 
2 files changed, 9 insertions, 1 deletions
| diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 0632d937c4c..5e154805644 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -565,6 +565,14 @@ pub struct Block { pub rules: BlockCheckMode, pub span: Span, pub tokens: Option<LazyTokenStream>, + /// The following *isn't* a parse error, but will cause multiple errors in following stages. + /// ``` + /// let x = { + /// foo: var + /// }; + /// ``` + /// #34255 + pub could_be_bare_literal: bool, } /// A match pattern. diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs index 368a23e3429..4d9fc6554e7 100644 --- a/compiler/rustc_ast/src/mut_visit.rs +++ b/compiler/rustc_ast/src/mut_visit.rs @@ -949,7 +949,7 @@ pub fn noop_visit_mt<T: MutVisitor>(MutTy { ty, mutbl: _ }: &mut MutTy, vis: &mu } pub fn noop_visit_block<T: MutVisitor>(block: &mut P<Block>, vis: &mut T) { - let Block { id, stmts, rules: _, span, tokens } = block.deref_mut(); + let Block { id, stmts, rules: _, span, tokens, could_be_bare_literal: _ } = block.deref_mut(); vis.visit_id(id); stmts.flat_map_in_place(|stmt| vis.flat_map_stmt(stmt)); vis.visit_span(span); | 
