mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Merge #4445
4445: Correctly fill default type parameters r=flodiebold a=montekki Fixes #3877 So, basically even if the parameters are omitted from the `impl` block, check the parameters in `trait` if they have a default type, and if they do go from `hir` to `ast::TypeArg`. I've added a helper for that but I am not sure that it's a proper way to go from `hir` to `ast` here. Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
This commit is contained in:
commit
f1587ac263
5 changed files with 92 additions and 2 deletions
|
@ -13,6 +13,10 @@ pub fn name_ref(text: &str) -> ast::NameRef {
|
|||
ast_from_text(&format!("fn f() {{ {}; }}", text))
|
||||
}
|
||||
|
||||
pub fn type_ref(text: &str) -> ast::TypeRef {
|
||||
ast_from_text(&format!("impl {} for D {{}};", text))
|
||||
}
|
||||
|
||||
pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment {
|
||||
ast_from_text(&format!("use {};", name_ref))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue