about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2014-09-16 22:46:38 +0300
committerEduard Burtescu <edy.burt@gmail.com>2014-09-18 14:36:18 +0300
commite35e47f5c19e63e8e25c4004ba6a28534ad3df42 (patch)
tree1f257891fd9de36d4895d2a622b884ab0e309e96
parent07f4fda598f3fa3e7980f7d97621879fbbf00750 (diff)
downloadrust-e35e47f5c19e63e8e25c4004ba6a28534ad3df42.tar.gz
rust-e35e47f5c19e63e8e25c4004ba6a28534ad3df42.zip
rustc: fix fallout from removing the use of Gc for ExpnInfo.
-rw-r--r--src/librustc/lint/builtin.rs4
-rw-r--r--src/librustc/middle/liveness.rs5
-rw-r--r--src/librustc/middle/save/mod.rs2
-rw-r--r--src/librustc/middle/save/span_utils.rs2
4 files changed, 7 insertions, 6 deletions
diff --git a/src/librustc/lint/builtin.rs b/src/librustc/lint/builtin.rs
index 473c3935769..d8ad289af78 100644
--- a/src/librustc/lint/builtin.rs
+++ b/src/librustc/lint/builtin.rs
@@ -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(..) => {
diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs
index fee6c77a799..5977d663434 100644
--- a/src/librustc/middle/liveness.rs
+++ b/src/librustc/middle/liveness.rs
@@ -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:");
diff --git a/src/librustc/middle/save/mod.rs b/src/librustc/middle/save/mod.rs
index cab83f4cda2..578bddbc5b1 100644
--- a/src/librustc/middle/save/mod.rs
+++ b/src/librustc/middle/save/mod.rs
@@ -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> {
diff --git a/src/librustc/middle/save/span_utils.rs b/src/librustc/middle/save/span_utils.rs
index 57006d5e72b..1086dc608a3 100644
--- a/src/librustc/middle/save/span_utils.rs
+++ b/src/librustc/middle/save/span_utils.rs
@@ -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,
                 })
             }
         }