File tree Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Expand file tree Collapse file tree 1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 11use std:: iter;
2- use std:: ops:: ControlFlow ;
32
43use rustc_ast as ast;
54use rustc_ast:: util:: { classify, parser} ;
@@ -781,29 +780,6 @@ trait UnusedDelimLint {
781780 right_pos : Option < BytePos > ,
782781 is_kw : bool ,
783782 ) {
784- // If `value` has `ExprKind::Err`, unused delim lint can be broken.
785- // For example, the following code caused ICE.
786- // This is because the `ExprKind::Call` in `value` has `ExprKind::Err` as its argument
787- // and this leads to wrong spans. #104897
788- //
789- // ```
790- // fn f(){(print!(á
791- // ```
792- use rustc_ast:: visit:: { Visitor , walk_expr} ;
793- struct ErrExprVisitor ;
794- impl < ' ast > Visitor < ' ast > for ErrExprVisitor {
795- type Result = ControlFlow < ( ) > ;
796- fn visit_expr ( & mut self , expr : & ' ast ast:: Expr ) -> ControlFlow < ( ) > {
797- if let ExprKind :: Err ( _) = expr. kind {
798- ControlFlow :: Break ( ( ) )
799- } else {
800- walk_expr ( self , expr)
801- }
802- }
803- }
804- if ErrExprVisitor . visit_expr ( value) . is_break ( ) {
805- return ;
806- }
807783 let spans = match value. kind {
808784 ast:: ExprKind :: Block ( ref block, None ) if let [ stmt] = block. stmts . as_slice ( ) => stmt
809785 . span
You can’t perform that action at this time.
0 commit comments