File tree 1 file changed +0
-24
lines changed
1 file changed +0
-24
lines changed Original file line number Diff line number Diff line change 1
1
use std:: iter;
2
- use std:: ops:: ControlFlow ;
3
2
4
3
use rustc_ast as ast;
5
4
use rustc_ast:: util:: { classify, parser} ;
@@ -781,29 +780,6 @@ trait UnusedDelimLint {
781
780
right_pos : Option < BytePos > ,
782
781
is_kw : bool ,
783
782
) {
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
- }
807
783
let spans = match value. kind {
808
784
ast:: ExprKind :: Block ( ref block, None ) if let [ stmt] = block. stmts . as_slice ( ) => stmt
809
785
. span
You can’t perform that action at this time.
0 commit comments