internal: replace AstTransformer with mutable syntax trees

This commit is contained in:
Aleksey Kladov 2021-05-18 14:42:41 +03:00
parent 3cfe2d0a5d
commit 47d7434dde
6 changed files with 123 additions and 208 deletions

View file

@ -106,6 +106,10 @@ pub fn impl_trait(trait_: ast::Path, ty: ast::Path) -> ast::Impl {
ast_from_text(&format!("impl {} for {} {{}}", trait_, ty))
}
pub(crate) fn generic_arg_list() -> ast::GenericArgList {
ast_from_text("const S: T<> = ();")
}
pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment {
ast_from_text(&format!("use {};", name_ref))
}