mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Make ast_to_token_tree
infallible
It could never return `None`, so reflect that in the return type
This commit is contained in:
parent
bcf600fc88
commit
3abcdc03ba
11 changed files with 32 additions and 41 deletions
|
@ -106,7 +106,7 @@ pub fn expand_eager_macro(
|
|||
mut diagnostic_sink: &mut dyn FnMut(mbe::ExpandError),
|
||||
) -> Result<EagerMacroId, ErrorEmitted> {
|
||||
let parsed_args = diagnostic_sink.option_with(
|
||||
|| Some(mbe::ast_to_token_tree(¯o_call.value.token_tree()?)?.0),
|
||||
|| Some(mbe::ast_to_token_tree(¯o_call.value.token_tree()?).0),
|
||||
|| err("malformed macro invocation"),
|
||||
)?;
|
||||
|
||||
|
@ -161,7 +161,7 @@ pub fn expand_eager_macro(
|
|||
}
|
||||
|
||||
fn to_subtree(node: &SyntaxNode) -> Option<tt::Subtree> {
|
||||
let mut subtree = mbe::syntax_node_to_token_tree(node)?.0;
|
||||
let mut subtree = mbe::syntax_node_to_token_tree(node).0;
|
||||
subtree.delimiter = None;
|
||||
Some(subtree)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue