@@ -674,11 +674,6 @@ struct DiagMetadata<'ast> {
674674 /// they are used (in a `break` or `continue` statement)
675675 unused_labels : FxHashMap < NodeId , Span > ,
676676
677- /// Only used for better errors on `let x = { foo: bar };`.
678- /// In the case of a parse error with `let x = { foo: bar, };`, this isn't needed, it's only
679- /// needed for cases where this parses as a correct type ascription.
680- current_block_could_be_bare_struct_literal : Option < Span > ,
681-
682677 /// Only used for better errors on `let <pat>: <expr, not type>;`.
683678 current_let_binding : Option < ( Span , Option < Span > , Option < Span > ) > ,
684679
@@ -4650,13 +4645,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
46504645 self . ribs [ ValueNS ] . push ( Rib :: new ( RibKind :: Normal ) ) ;
46514646 }
46524647
4653- let prev = self . diag_metadata . current_block_could_be_bare_struct_literal . take ( ) ;
4654- if let ( true , [ Stmt { kind : StmtKind :: Expr ( expr) , .. } ] ) =
4655- ( block. could_be_bare_literal , & block. stmts [ ..] )
4656- && let ExprKind :: Type ( ..) = expr. kind
4657- {
4658- self . diag_metadata . current_block_could_be_bare_struct_literal = Some ( block. span ) ;
4659- }
46604648 // Descend into the block.
46614649 for stmt in & block. stmts {
46624650 if let StmtKind :: Item ( ref item) = stmt. kind
@@ -4670,7 +4658,6 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> {
46704658
46714659 self . visit_stmt ( stmt) ;
46724660 }
4673- self . diag_metadata . current_block_could_be_bare_struct_literal = prev;
46744661
46754662 // Move back up.
46764663 self . parent_scope . module = orig_module;
0 commit comments