]> git.lizzy.rs Git - rust.git/commitdiff
use CompilerDesugaringKind
authorFrederick Zhang <frederick888@tsundere.moe>
Sat, 19 Aug 2017 08:03:29 +0000 (18:03 +1000)
committerFrederick Zhang <frederick888@tsundere.moe>
Sat, 19 Aug 2017 08:03:29 +0000 (18:03 +1000)
clippy_lints/src/utils/mod.rs

index d62f3963bc312228586235cf03c64608e3fa78f1..f3fae14bae8a80769d001c717bc45fee2a68a5ba 100644 (file)
@@ -16,7 +16,7 @@
 use std::str::FromStr;
 use syntax::ast::{self, LitKind};
 use syntax::attr;
-use syntax::codemap::{ExpnFormat, ExpnInfo, Span, DUMMY_SP};
+use syntax::codemap::{CompilerDesugaringKind, ExpnFormat, ExpnInfo, Span, DUMMY_SP};
 use syntax::errors::DiagnosticBuilder;
 use syntax::ptr::P;
 use syntax::symbol::keywords;
@@ -114,7 +114,7 @@ pub fn in_constant(cx: &LateContext, id: NodeId) -> bool {
 pub fn in_macro(span: Span) -> bool {
     span.ctxt.outer().expn_info().map_or(false, |info| {
         match info.callee.format {// don't treat range expressions desugared to structs as "in_macro"
-            ExpnFormat::CompilerDesugaring(name) => name != "...",
+            ExpnFormat::CompilerDesugaring(kind) => kind != CompilerDesugaringKind::DotFill,
             _ => true,
         }
     })