Add basic support for delegation

This commit is contained in:
Ryan Levick 2021-10-13 15:08:40 +02:00
parent 1619fa9d8f
commit 0ff89deb69
4 changed files with 161 additions and 0 deletions

View file

@ -124,6 +124,10 @@ pub fn assoc_item_list() -> ast::AssocItemList {
ast_from_text("impl C for D {}")
}
pub fn impl_(ty: ast::Path) -> ast::Impl {
ast_from_text(&format!("impl {} {{}}", ty))
}
pub fn impl_trait(trait_: ast::Path, ty: ast::Path) -> ast::Impl {
ast_from_text(&format!("impl {} for {} {{}}", trait_, ty))
}