]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/double_parens.rs
Auto merge of #4551 - mikerite:fix-ice-reporting, r=llogiq
[rust.git] / clippy_lints / src / double_parens.rs
index f39ea6a3cc5a36d8e48a0a3dcd7b17ff5533ca26..5e1a860ae80fa895d0b224c802a5684944a43b6d 100644 (file)
@@ -1,4 +1,4 @@
-use crate::utils::{in_macro_or_desugar, span_lint};
+use crate::utils::span_lint;
 use rustc::lint::{EarlyContext, EarlyLintPass, LintArray, LintPass};
 use rustc::{declare_lint_pass, declare_tool_lint};
 use syntax::ast::*;
     ///
     /// **Example:**
     /// ```rust
-    /// ((0))
-    /// foo((0))
-    /// ((1, 2))
+    /// # fn foo(bar: usize) {}
+    /// ((0));
+    /// foo((0));
+    /// ((1, 2));
     /// ```
     pub DOUBLE_PARENS,
     complexity,
@@ -26,7 +27,7 @@
 
 impl EarlyLintPass for DoubleParens {
     fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
-        if in_macro_or_desugar(expr.span) {
+        if expr.span.from_expansion() {
             return;
         }