Skip to content

Commit e35e47f

Browse files
committed
rustc: fix fallout from removing the use of Gc for ExpnInfo.
1 parent 07f4fda commit e35e47f

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

src/librustc/lint/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use syntax::abi;
4242
use syntax::ast_map;
4343
use syntax::attr::AttrMetaMethods;
4444
use syntax::attr;
45-
use syntax::codemap::Span;
45+
use syntax::codemap::{Span, NO_EXPANSION};
4646
use syntax::parse::token;
4747
use syntax::{ast, ast_util, visit};
4848
use syntax::ptr::P;
@@ -1492,7 +1492,7 @@ impl LintPass for Stability {
14921492

14931493
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
14941494
// if the expression was produced by a macro expansion,
1495-
if e.span.expn_info.is_some() { return }
1495+
if e.span.expn_id != NO_EXPANSION { return }
14961496

14971497
let id = match e.node {
14981498
ast::ExprPath(..) | ast::ExprStruct(..) => {

src/librustc/middle/liveness.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,11 +1520,12 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
15201520
sp, "not all control paths return a value");
15211521
if ends_with_stmt {
15221522
let last_stmt = body.stmts.last().unwrap();
1523-
let original_span = original_sp(last_stmt.span, sp);
1523+
let original_span = original_sp(self.ir.tcx.sess.codemap(),
1524+
last_stmt.span, sp);
15241525
let span_semicolon = Span {
15251526
lo: original_span.hi - BytePos(1),
15261527
hi: original_span.hi,
1527-
expn_info: original_span.expn_info
1528+
expn_id: original_span.expn_id
15281529
};
15291530
self.ir.tcx.sess.span_note(
15301531
span_semicolon, "consider removing this semicolon:");

src/librustc/middle/save/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ fn escape(s: String) -> String {
7171

7272
// If the expression is a macro expansion or other generated code, run screaming and don't index.
7373
fn generated_code(span: Span) -> bool {
74-
span.expn_info.is_some() || span == DUMMY_SP
74+
span.expn_id != NO_EXPANSION || span == DUMMY_SP
7575
}
7676

7777
struct DxrVisitor<'l, 'tcx: 'l> {

src/librustc/middle/save/span_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl<'a> SpanUtils<'a> {
5757
Some(Span {
5858
lo: base + self.sess.codemap().lookup_byte_offset(sub.lo).pos,
5959
hi: base + self.sess.codemap().lookup_byte_offset(sub.hi).pos,
60-
expn_info: None,
60+
expn_id: NO_EXPANSION,
6161
})
6262
}
6363
}

0 commit comments

Comments
 (0)