mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Change type_arg to type_ref func
This commit is contained in:
parent
a55ad20388
commit
7e9396c7eb
2 changed files with 3 additions and 4 deletions
|
@ -64,12 +64,11 @@ impl<'a> SubstituteTypeParams<'a> {
|
||||||
let default = k.default(source_scope.db)?;
|
let default = k.default(source_scope.db)?;
|
||||||
Some((
|
Some((
|
||||||
k,
|
k,
|
||||||
ast::make::type_arg(
|
ast::make::type_ref(
|
||||||
&default
|
&default
|
||||||
.display_source_code(source_scope.db, source_scope.module()?.into())
|
.display_source_code(source_scope.db, source_scope.module()?.into())
|
||||||
.ok()?,
|
.ok()?,
|
||||||
)
|
)
|
||||||
.type_ref()?,
|
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -13,8 +13,8 @@ pub fn name_ref(text: &str) -> ast::NameRef {
|
||||||
ast_from_text(&format!("fn f() {{ {}; }}", text))
|
ast_from_text(&format!("fn f() {{ {}; }}", text))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn type_arg(text: &str) -> ast::TypeArg {
|
pub fn type_ref(text: &str) -> ast::TypeRef {
|
||||||
ast_from_text(&format!("impl F<{}> for G {{}}", text))
|
ast_from_text(&format!("impl {} for D {{}};", text))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment {
|
pub fn path_segment(name_ref: ast::NameRef) -> ast::PathSegment {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue