From c1cb5953820f26d4d0a614650bc8c50cbc5a3ce6 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 15 Dec 2020 15:37:37 +0100 Subject: Move to upstream `macro_rules!` model --- crates/mbe/src/mbe_expander.rs | 2 +- crates/mbe/src/tests.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/mbe') diff --git a/crates/mbe/src/mbe_expander.rs b/crates/mbe/src/mbe_expander.rs index 97bce0536..a80b73db4 100644 --- a/crates/mbe/src/mbe_expander.rs +++ b/crates/mbe/src/mbe_expander.rs @@ -163,7 +163,7 @@ mod tests { fn create_rules(macro_definition: &str) -> crate::MacroRules { let source_file = ast::SourceFile::parse(macro_definition).ok().unwrap(); let macro_definition = - source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); + source_file.syntax().descendants().find_map(ast::MacroRules::cast).unwrap(); let (definition_tt, _) = ast_to_token_tree(¯o_definition.token_tree().unwrap()).unwrap(); diff --git a/crates/mbe/src/tests.rs b/crates/mbe/src/tests.rs index 843054fe8..dff6e98c2 100644 --- a/crates/mbe/src/tests.rs +++ b/crates/mbe/src/tests.rs @@ -48,7 +48,7 @@ mod rule_parsing { let macro_definition = format!(" macro_rules! m {{ {} }} ", arm_definition); let source_file = ast::SourceFile::parse(¯o_definition).ok().unwrap(); let macro_definition = - source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); + source_file.syntax().descendants().find_map(ast::MacroRules::cast).unwrap(); let (definition_tt, _) = ast_to_token_tree(¯o_definition.token_tree().unwrap()).unwrap(); @@ -1668,7 +1668,7 @@ impl MacroFixture { fn parse_macro_to_tt(ra_fixture: &str) -> tt::Subtree { let source_file = ast::SourceFile::parse(ra_fixture).ok().unwrap(); let macro_definition = - source_file.syntax().descendants().find_map(ast::MacroCall::cast).unwrap(); + source_file.syntax().descendants().find_map(ast::MacroRules::cast).unwrap(); let (definition_tt, _) = ast_to_token_tree(¯o_definition.token_tree().unwrap()).unwrap(); -- cgit v1.2.3