File tree Expand file tree Collapse file tree 6 files changed +11
-9
lines changed
rustc_ast_pretty/src/pprust Expand file tree Collapse file tree 6 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ use crate::{ast, token::Delimiter};
4242/// _ => m! {} - 1, // binary subtraction operator
4343/// }
4444/// ```
45- pub fn expr_requires_semi_to_be_stmt ( e : & ast:: Expr ) -> bool {
45+ #[ allow( non_snake_case) ]
46+ pub fn expr_requires_semi_to_be_stmt_FIXME ( e : & ast:: Expr ) -> bool {
4647 !matches ! (
4748 e. kind,
4849 ast:: ExprKind :: If ( ..)
Original file line number Diff line number Diff line change @@ -1253,7 +1253,7 @@ impl<'a> State<'a> {
12531253 ast:: StmtKind :: Expr ( expr) => {
12541254 self . space_if_not_bol ( ) ;
12551255 self . print_expr_outer_attr_style ( expr, false , FixupContext :: new_stmt ( ) ) ;
1256- if classify:: expr_requires_semi_to_be_stmt ( expr) {
1256+ if classify:: expr_requires_semi_to_be_stmt_FIXME ( expr) {
12571257 self . word ( ";" ) ;
12581258 }
12591259 }
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ impl FixupContext {
128128 /// The documentation on `FixupContext::leftmost_subexpression_in_stmt` has
129129 /// examples.
130130 pub fn would_cause_statement_boundary ( self , expr : & Expr ) -> bool {
131- self . leftmost_subexpression_in_stmt && !classify:: expr_requires_semi_to_be_stmt ( expr)
131+ self . leftmost_subexpression_in_stmt && !classify:: expr_requires_semi_to_be_stmt_FIXME ( expr)
132132 }
133133
134134 /// Determine whether parentheses are needed around the given `let`
Original file line number Diff line number Diff line change @@ -688,7 +688,7 @@ trait UnusedDelimLint {
688688 ExprKind :: Index ( base, _subscript, _) => base,
689689 _ => break ,
690690 } ;
691- if !classify:: expr_requires_semi_to_be_stmt ( innermost) {
691+ if !classify:: expr_requires_semi_to_be_stmt_FIXME ( innermost) {
692692 return true ;
693693 }
694694 }
Original file line number Diff line number Diff line change @@ -498,7 +498,7 @@ impl<'a> Parser<'a> {
498498 /// Checks if this expression is a successfully parsed statement.
499499 fn expr_is_complete ( & self , e : & Expr ) -> bool {
500500 self . restrictions . contains ( Restrictions :: STMT_EXPR )
501- && !classify:: expr_requires_semi_to_be_stmt ( e)
501+ && !classify:: expr_requires_semi_to_be_stmt_FIXME ( e)
502502 }
503503
504504 /// Parses `x..y`, `x..=y`, and `x..`/`x..=`.
@@ -2694,7 +2694,7 @@ impl<'a> Parser<'a> {
26942694 // If it's not a free-standing expression, and is followed by a block,
26952695 // then it's very likely the condition to an `else if`.
26962696 if self . check ( & TokenKind :: OpenDelim ( Delimiter :: Brace ) )
2697- && classify:: expr_requires_semi_to_be_stmt ( & cond) =>
2697+ && classify:: expr_requires_semi_to_be_stmt_FIXME ( & cond) =>
26982698 {
26992699 self . dcx ( ) . emit_err ( errors:: ExpectedElseBlock {
27002700 first_tok_span,
@@ -3136,7 +3136,7 @@ impl<'a> Parser<'a> {
31363136 err
31373137 } ) ?;
31383138
3139- let require_comma = classify:: expr_requires_semi_to_be_stmt ( & expr)
3139+ let require_comma = classify:: expr_requires_semi_to_be_stmt_FIXME ( & expr)
31403140 && this. token != token:: CloseDelim ( Delimiter :: Brace ) ;
31413141
31423142 if !require_comma {
Original file line number Diff line number Diff line change @@ -648,7 +648,7 @@ impl<'a> Parser<'a> {
648648 match & mut stmt. kind {
649649 // Expression without semicolon.
650650 StmtKind :: Expr ( expr)
651- if classify:: expr_requires_semi_to_be_stmt ( expr)
651+ if classify:: expr_requires_semi_to_be_stmt_FIXME ( expr)
652652 && !expr. attrs . is_empty ( )
653653 && ![ token:: Eof , token:: Semi , token:: CloseDelim ( Delimiter :: Brace ) ]
654654 . contains ( & self . token . kind ) =>
@@ -662,7 +662,8 @@ impl<'a> Parser<'a> {
662662
663663 // Expression without semicolon.
664664 StmtKind :: Expr ( expr)
665- if self . token != token:: Eof && classify:: expr_requires_semi_to_be_stmt ( expr) =>
665+ if self . token != token:: Eof
666+ && classify:: expr_requires_semi_to_be_stmt_FIXME ( expr) =>
666667 {
667668 // Just check for errors and recover; do not eat semicolon yet.
668669
You can’t perform that action at this time.
0 commit comments