Correctly fill default type parameters

This commit is contained in:
Fedor Sakharov 2020-05-13 16:06:42 +03:00
parent 88d3959c33
commit 00f3b6c59a
No known key found for this signature in database
GPG key ID: 93D436E666BF0FEE
6 changed files with 80 additions and 1 deletions

View file

@ -13,6 +13,10 @@ pub fn name_ref(text: &str) -> ast::NameRef {
ast_from_text(&format!("fn f() {{ {}; }}", text))
}
pub fn type_arg(text: &str) -> ast::TypeArg {
ast_from_text(&format!("impl F<{}> for G {{}}", text))
}
pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment {
ast_from_text(&format!("use {};", name_ref))
}