rustc: fix fallout from removing the use of Gc for ExpnInfo.
This commit is contained in:
parent
07f4fda598
commit
e35e47f5c1
4 changed files with 7 additions and 6 deletions
|
|
@ -42,7 +42,7 @@ use syntax::abi;
|
|||
use syntax::ast_map;
|
||||
use syntax::attr::AttrMetaMethods;
|
||||
use syntax::attr;
|
||||
use syntax::codemap::Span;
|
||||
use syntax::codemap::{Span, NO_EXPANSION};
|
||||
use syntax::parse::token;
|
||||
use syntax::{ast, ast_util, visit};
|
||||
use syntax::ptr::P;
|
||||
|
|
@ -1492,7 +1492,7 @@ impl LintPass for Stability {
|
|||
|
||||
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
|
||||
// if the expression was produced by a macro expansion,
|
||||
if e.span.expn_info.is_some() { return }
|
||||
if e.span.expn_id != NO_EXPANSION { return }
|
||||
|
||||
let id = match e.node {
|
||||
ast::ExprPath(..) | ast::ExprStruct(..) => {
|
||||
|
|
|
|||
|
|
@ -1520,11 +1520,12 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
|
|||
sp, "not all control paths return a value");
|
||||
if ends_with_stmt {
|
||||
let last_stmt = body.stmts.last().unwrap();
|
||||
let original_span = original_sp(last_stmt.span, sp);
|
||||
let original_span = original_sp(self.ir.tcx.sess.codemap(),
|
||||
last_stmt.span, sp);
|
||||
let span_semicolon = Span {
|
||||
lo: original_span.hi - BytePos(1),
|
||||
hi: original_span.hi,
|
||||
expn_info: original_span.expn_info
|
||||
expn_id: original_span.expn_id
|
||||
};
|
||||
self.ir.tcx.sess.span_note(
|
||||
span_semicolon, "consider removing this semicolon:");
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ fn escape(s: String) -> String {
|
|||
|
||||
// If the expression is a macro expansion or other generated code, run screaming and don't index.
|
||||
fn generated_code(span: Span) -> bool {
|
||||
span.expn_info.is_some() || span == DUMMY_SP
|
||||
span.expn_id != NO_EXPANSION || span == DUMMY_SP
|
||||
}
|
||||
|
||||
struct DxrVisitor<'l, 'tcx: 'l> {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ impl<'a> SpanUtils<'a> {
|
|||
Some(Span {
|
||||
lo: base + self.sess.codemap().lookup_byte_offset(sub.lo).pos,
|
||||
hi: base + self.sess.codemap().lookup_byte_offset(sub.hi).pos,
|
||||
expn_info: None,
|
||||
expn_id: NO_EXPANSION,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue