1
Fork 0

Fix fallout in tests from removing the use of Gc in ExpnInfo.

This commit is contained in:
Eduard Burtescu 2014-09-18 14:36:01 +03:00
parent e35e47f5c1
commit f1a8f53cf1
9 changed files with 15 additions and 15 deletions

View file

@ -211,7 +211,7 @@ fn parse_antlr_token(s: &str, tokens: &HashMap<String, Token>) -> TokenAndSpan {
let sp = syntax::codemap::Span {
lo: syntax::codemap::BytePos(from_str::<u32>(start).unwrap() - offset),
hi: syntax::codemap::BytePos(from_str::<u32>(end).unwrap() + 1),
expn_info: None
expn_id: syntax::codemap::NO_EXPANSION
};
TokenAndSpan {

View file

@ -2035,7 +2035,7 @@ impl fake_ext_ctxt for parse::ParseSess {
codemap::Span {
lo: codemap::BytePos(0),
hi: codemap::BytePos(0),
expn_info: None
expn_id: codemap::NO_EXPANSION
}
}
fn ident_of(&self, st: &str) -> ast::Ident {

View file

@ -1363,7 +1363,7 @@ mod test {
inner: Span {
lo: BytePos(11),
hi: BytePos(19),
expn_info: None,
expn_id: NO_EXPANSION,
},
view_items: Vec::new(),
items: Vec::new(),
@ -1373,7 +1373,7 @@ mod test {
span: Span {
lo: BytePos(10),
hi: BytePos(20),
expn_info: None,
expn_id: NO_EXPANSION,
},
exported_macros: Vec::new(),
};

View file

@ -686,7 +686,7 @@ mod test {
fn t7() {
// Test span_to_lines for a span ending at the end of filemap
let cm = init_code_map();
let span = Span {lo: BytePos(12), hi: BytePos(23), expn_info: None};
let span = Span {lo: BytePos(12), hi: BytePos(23), expn_id: NO_EXPANSION};
let file_lines = cm.span_to_lines(span);
assert_eq!(file_lines.file.name, "blork.rs".to_string());
@ -698,7 +698,7 @@ mod test {
fn t8() {
// Test span_to_snippet for a span ending at the end of filemap
let cm = init_code_map();
let span = Span {lo: BytePos(12), hi: BytePos(23), expn_info: None};
let span = Span {lo: BytePos(12), hi: BytePos(23), expn_id: NO_EXPANSION};
let snippet = cm.span_to_snippet(span);
assert_eq!(snippet, Some("second line".to_string()));
@ -708,7 +708,7 @@ mod test {
fn t9() {
// Test span_to_str for a span ending at the end of filemap
let cm = init_code_map();
let span = Span {lo: BytePos(12), hi: BytePos(23), expn_info: None};
let span = Span {lo: BytePos(12), hi: BytePos(23), expn_id: NO_EXPANSION};
let sstr = cm.span_to_string(span);
assert_eq!(sstr, "blork.rs:2:1: 2:12".to_string());

View file

@ -1406,7 +1406,7 @@ fn ident_continue(c: Option<char>) -> bool {
mod test {
use super::*;
use codemap::{BytePos, CodeMap, Span};
use codemap::{BytePos, CodeMap, Span, NO_EXPANSION};
use diagnostic;
use parse::token;
use parse::token::{str_to_ident};
@ -1436,7 +1436,7 @@ mod test {
let tok1 = string_reader.next_token();
let tok2 = TokenAndSpan{
tok:token::IDENT(id, false),
sp:Span {lo:BytePos(21),hi:BytePos(23),expn_info: None}};
sp:Span {lo:BytePos(21),hi:BytePos(23),expn_id: NO_EXPANSION}};
assert_eq!(tok1,tok2);
assert_eq!(string_reader.next_token().tok, token::WS);
// the 'main' id is already read:
@ -1445,7 +1445,7 @@ mod test {
let tok3 = string_reader.next_token();
let tok4 = TokenAndSpan{
tok:token::IDENT(str_to_ident("main"), false),
sp:Span {lo:BytePos(24),hi:BytePos(28),expn_info: None}};
sp:Span {lo:BytePos(24),hi:BytePos(28),expn_id: NO_EXPANSION}};
assert_eq!(tok3,tok4);
// the lparen is already read:
assert_eq!(string_reader.last_pos.clone(), BytePos(29))

View file

@ -721,7 +721,7 @@ pub fn integer_lit(s: &str, sd: &SpanHandler, sp: Span) -> ast::Lit_ {
mod test {
use super::*;
use serialize::json;
use codemap::{Span, BytePos, Spanned};
use codemap::{Span, BytePos, Spanned, NO_EXPANSION};
use owned_slice::OwnedSlice;
use ast;
use abi;
@ -736,7 +736,7 @@ mod test {
// produce a codemap::span
fn sp(a: u32, b: u32) -> Span {
Span{lo:BytePos(a),hi:BytePos(b),expn_info:None}
Span {lo: BytePos(a), hi: BytePos(b), expn_id: NO_EXPANSION}
}
#[test] fn path_exprs_1() {

View file

@ -39,7 +39,7 @@ impl fake_ext_ctxt for fake_session {
codemap::span {
lo: codemap::BytePos(0),
hi: codemap::BytePos(0),
expn_info: None
expn_id: NO_EXPANSION
}
}
fn ident_of(st: &str) -> ast::ident {

View file

@ -36,7 +36,7 @@ impl fake_ext_ctxt for fake_session {
codemap::span {
lo: codemap::BytePos(0),
hi: codemap::BytePos(0),
expn_info: None
expn_id: codemap::NO_EXPANSION
}
}
fn ident_of(st: &str) -> ast::ident {

View file

@ -41,7 +41,7 @@ impl fake_ext_ctxt for fake_session {
codemap::span {
lo: codemap::BytePos(0),
hi: codemap::BytePos(0),
expn_info: None
expn_id: codemap::NO_EXPANSION
}
}
fn ident_of(st: &str) -> ast::ident {