File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -90,19 +90,11 @@ declare_lint! {
9090
9191declare_lint_pass ! ( WhileTrue => [ WHILE_TRUE ] ) ;
9292
93- /// Traverse through any amount of parenthesis and return the first non-parens expression.
94- fn pierce_parens ( mut expr : & ast:: Expr ) -> & ast:: Expr {
95- while let ast:: ExprKind :: Paren ( sub) = & expr. kind {
96- expr = sub;
97- }
98- expr
99- }
100-
10193impl EarlyLintPass for WhileTrue {
10294 #[ inline]
10395 fn check_expr ( & mut self , cx : & EarlyContext < ' _ > , e : & ast:: Expr ) {
10496 if let ast:: ExprKind :: While ( cond, _, label) = & e. kind
105- && let ast:: ExprKind :: Lit ( token_lit) = pierce_parens ( cond) . kind
97+ && let ast:: ExprKind :: Lit ( token_lit) = cond. peel_parens ( ) . kind
10698 && let token:: Lit { kind : token:: Bool , symbol : kw:: True , .. } = token_lit
10799 && !cond. span . from_expansion ( )
108100 {
@@ -2657,7 +2649,7 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue {
26572649}
26582650
26592651declare_lint ! {
2660- /// The `deref_nullptr` lint detects when an null pointer is dereferenced,
2652+ /// The `deref_nullptr` lint detects when a null pointer is dereferenced,
26612653 /// which causes [undefined behavior].
26622654 ///
26632655 /// ### Example
You can’t perform that action at this time.
0 commit comments