diff options
Diffstat (limited to 'crates/syntax/src/ast/make.rs')
-rw-r--r-- | crates/syntax/src/ast/make.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 580eb3690..3a184094c 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs | |||
@@ -21,6 +21,10 @@ pub fn ty(text: &str) -> ast::Type { | |||
21 | ast_from_text(&format!("impl {} for D {{}};", text)) | 21 | ast_from_text(&format!("impl {} for D {{}};", text)) |
22 | } | 22 | } |
23 | 23 | ||
24 | pub fn assoc_item_list() -> ast::AssocItemList { | ||
25 | ast_from_text("impl C for D {};") | ||
26 | } | ||
27 | |||
24 | pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { | 28 | pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment { |
25 | ast_from_text(&format!("use {};", name_ref)) | 29 | ast_from_text(&format!("use {};", name_ref)) |
26 | } | 30 | } |
@@ -61,6 +65,10 @@ pub fn path_from_segments( | |||
61 | }) | 65 | }) |
62 | } | 66 | } |
63 | 67 | ||
68 | pub fn glob_use_tree() -> ast::UseTree { | ||
69 | ast_from_text("use *;") | ||
70 | } | ||
71 | |||
64 | pub fn use_tree( | 72 | pub fn use_tree( |
65 | path: ast::Path, | 73 | path: ast::Path, |
66 | use_tree_list: Option<ast::UseTreeList>, | 74 | use_tree_list: Option<ast::UseTreeList>, |