Merge pull request #1971 from Frederick888/fix-1970

Try to fix #1970
This commit is contained in:
Oliver Schneider 2017-08-21 09:35:59 +02:00 committed by GitHub
commit b005748b85

View file

@ -16,7 +16,7 @@ use std::mem;
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,
}
})