mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
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>.
This commit is contained in:
parent
632fa8ef4a
commit
62f594b390
3 changed files with 56 additions and 65 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue