use syntax::ast;
use syntax::attr;
use syntax::feature_gate::{AttributeGate, AttributeType, Stability, deprecated_attributes};
-use syntax_pos::Span;
+use syntax_pos::{Span, SyntaxContext};
use syntax::symbol::keywords;
use rustc::hir::{self, PatKind};
if let hir::ExprWhile(ref cond, ..) = e.node {
if let hir::ExprLit(ref lit) = cond.node {
if let ast::LitKind::Bool(true) = lit.node {
- cx.span_lint(WHILE_TRUE,
- e.span,
- "denote infinite loops with loop { ... }");
+ if lit.span.ctxt() == SyntaxContext::empty() {
+ cx.span_lint(WHILE_TRUE,
+ e.span,
+ "denote infinite loops with loop { ... }");
+ }
}
}
}
sp: Span,
tts: &[tokenstream::TokenTree])
-> Box<base::MacResult + 'static> {
+ let sp = sp.with_ctxt(sp.ctxt().apply_mark(cx.current_expansion.mark));
let mut p = cx.new_parser_from_tts(tts);
let cfg = panictry!(p.parse_meta_item());
Some(v) => v,
};
+ let sp = sp.with_ctxt(sp.ctxt().apply_mark(cx.current_expansion.mark));
let e = match env::var(&*var.as_str()) {
Err(..) => {
cx.expr_path(cx.path_all(sp,