From 62f594b390e5f648a32b5b08863a6413b4271d19 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Sat, 6 Mar 2021 09:46:32 -0700 Subject: Refactor TokenStream to hold Vec 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, pub token_trees: Vec`, so a Subtree that is statically guaranteed not to have a delimiter is just Vec. --- crates/proc_macro_srv/src/tests/utils.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/proc_macro_srv/src/tests/utils.rs') 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( let expander = dylib::Expander::new(&path).unwrap(); let fixture = parse_string(ra_fixture).unwrap(); - let res = expander.expand(macro_name, &fixture.subtree, None).unwrap(); + let res = expander.expand(macro_name, &fixture.into_subtree(), None).unwrap(); assert_eq_text!(&expect.trim(), &format!("{:?}", res)); } -- cgit v1.2.3