Skip to content

Commit d316874

Browse files
alexcrichtonjseyfried
authored andcommitted
Update and fix a few tests
1 parent 302935f commit d316874

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/libsyntax/parse/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ mod tests {
687687
id: ast::DUMMY_NODE_ID,
688688
node: ast::ExprKind::Path(None, ast::Path {
689689
span: sp(0, 6),
690-
segments: vec![ast::PathSegment::crate_root(),
690+
segments: vec![ast::PathSegment::crate_root(sp(0, 2)),
691691
str2seg("a", 2, 3),
692692
str2seg("b", 5, 6)]
693693
}),

src/libsyntax/util/parser_testing.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::iter::Peekable;
2020
/// Map a string to tts, using a made-up filename:
2121
pub fn string_to_stream(source_str: String) -> TokenStream {
2222
let ps = ParseSess::new(FilePathMapping::empty());
23-
filemap_to_stream(&ps, ps.codemap().new_filemap("bogofile".to_string(), source_str))
23+
filemap_to_stream(&ps, ps.codemap().new_filemap("bogofile".to_string(), source_str), None)
2424
}
2525

2626
/// Map string to parser (via tts)

src/test/run-pass-fulldeps/auxiliary/cond_plugin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// no-prefer-dynamic
1212

1313
#![crate_type = "proc-macro"]
14-
#![feature(proc_macro, proc_macro_lib)]
14+
#![feature(proc_macro)]
1515

1616
extern crate proc_macro;
1717

@@ -23,7 +23,7 @@ pub fn cond(input: TokenStream) -> TokenStream {
2323
let mut input = input.into_iter().peekable();
2424
while let Some(tree) = input.next() {
2525
let cond = match tree.kind {
26-
TokenNode::Sequence(_, cond) => cond,
26+
TokenNode::Group(_, cond) => cond,
2727
_ => panic!("Invalid input"),
2828
};
2929
let mut cond_trees = cond.clone().into_iter();
@@ -33,7 +33,7 @@ pub fn cond(input: TokenStream) -> TokenStream {
3333
panic!("Invalid macro usage in cond: {}", cond);
3434
}
3535
let is_else = match test.kind {
36-
TokenNode::Word(word) => word.as_str() == "else",
36+
TokenNode::Term(word) => word.as_str() == "else",
3737
_ => false,
3838
};
3939
conds.push(if is_else || input.peek().is_none() {

src/test/run-pass-fulldeps/proc-macro/auxiliary/count_compound_ops.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
extern crate proc_macro;
1717

18-
use proc_macro::{TokenStream, TokenNode, OpKind, Literal, quote};
18+
use proc_macro::{TokenStream, TokenNode, Spacing, Literal, quote};
1919

2020
#[proc_macro]
2121
pub fn count_compound_ops(input: TokenStream) -> TokenStream {
@@ -27,8 +27,8 @@ fn count_compound_ops_helper(input: TokenStream) -> u32 {
2727
let mut count = 0;
2828
for token in input {
2929
match token.kind {
30-
TokenNode::Op(c, OpKind::Alone) => count += 1,
31-
TokenNode::Sequence(_, tokens) => count += count_compound_ops_helper(tokens),
30+
TokenNode::Op(c, Spacing::Alone) => count += 1,
31+
TokenNode::Group(_, tokens) => count += count_compound_ops_helper(tokens),
3232
_ => {}
3333
}
3434
}

0 commit comments

Comments
 (0)