aboutsummaryrefslogtreecommitdiff
path: root/crates/proc_macro_srv/src/tests
diff options
context:
space:
mode:
authorKevin Mehall <[email protected]>2021-03-06 16:46:32 +0000
committerKevin Mehall <[email protected]>2021-03-06 16:48:30 +0000
commit62f594b390e5f648a32b5b08863a6413b4271d19 (patch)
tree47de88bc047e957149544f48f2696f2706b9ed4b /crates/proc_macro_srv/src/tests
parent632fa8ef4a3c9e7440b79e04a9f7dd9bd23a4de4 (diff)
Refactor TokenStream to hold Vec<TokenTree> instead of tt::Subtree
`TokenStream` assumes that its subtree's delimeter is `None`, and this should be encoded in the type system instead of having a delimiter field that is mostly ignored. `tt::Subtree` is just `pub delimiter: Option<Delimiter>, pub token_trees: Vec<TokenTree>`, so a Subtree that is statically guaranteed not to have a delimiter is just Vec<TokenTree>.
Diffstat (limited to 'crates/proc_macro_srv/src/tests')
-rw-r--r--crates/proc_macro_srv/src/tests/utils.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/proc_macro_srv/src/tests/utils.rs b/crates/proc_macro_srv/src/tests/utils.rs
index 22813052d..0484c3af4 100644
--- a/crates/proc_macro_srv/src/tests/utils.rs
+++ b/crates/proc_macro_srv/src/tests/utils.rs
@@ -52,7 +52,7 @@ pub fn assert_expand(
52 let expander = dylib::Expander::new(&path).unwrap(); 52 let expander = dylib::Expander::new(&path).unwrap();
53 let fixture = parse_string(ra_fixture).unwrap(); 53 let fixture = parse_string(ra_fixture).unwrap();
54 54
55 let res = expander.expand(macro_name, &fixture.subtree, None).unwrap(); 55 let res = expander.expand(macro_name, &fixture.into_subtree(), None).unwrap();
56 assert_eq_text!(&expect.trim(), &format!("{:?}", res)); 56 assert_eq_text!(&expect.trim(), &format!("{:?}", res));
57} 57}
58 58