aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/ast_transform.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/ast_transform.rs')
-rw-r--r--crates/ra_assists/src/ast_transform.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_assists/src/ast_transform.rs b/crates/ra_assists/src/ast_transform.rs
index 5ea4f9f5b..3265bd406 100644
--- a/crates/ra_assists/src/ast_transform.rs
+++ b/crates/ra_assists/src/ast_transform.rs
@@ -32,7 +32,7 @@ impl<'a> AstTransform<'a> for NullTransformer {
32 32
33pub struct SubstituteTypeParams<'a> { 33pub struct SubstituteTypeParams<'a> {
34 source_scope: &'a SemanticsScope<'a>, 34 source_scope: &'a SemanticsScope<'a>,
35 substs: FxHashMap<hir::TypeParam, ast::TypeRef>, 35 substs: FxHashMap<hir::TypeParam, ast::Type>,
36 previous: Box<dyn AstTransform<'a> + 'a>, 36 previous: Box<dyn AstTransform<'a> + 'a>,
37} 37}
38 38
@@ -80,17 +80,17 @@ impl<'a> SubstituteTypeParams<'a> {
80 80
81 // FIXME: It would probably be nicer if we could get this via HIR (i.e. get the 81 // FIXME: It would probably be nicer if we could get this via HIR (i.e. get the
82 // trait ref, and then go from the types in the substs back to the syntax) 82 // trait ref, and then go from the types in the substs back to the syntax)
83 fn get_syntactic_substs(impl_def: ast::Impl) -> Option<Vec<ast::TypeRef>> { 83 fn get_syntactic_substs(impl_def: ast::Impl) -> Option<Vec<ast::Type>> {
84 let target_trait = impl_def.target_trait()?; 84 let target_trait = impl_def.target_trait()?;
85 let path_type = match target_trait { 85 let path_type = match target_trait {
86 ast::TypeRef::PathType(path) => path, 86 ast::Type::PathType(path) => path,
87 _ => return None, 87 _ => return None,
88 }; 88 };
89 let type_arg_list = path_type.path()?.segment()?.type_arg_list()?; 89 let type_arg_list = path_type.path()?.segment()?.type_arg_list()?;
90 let mut result = Vec::new(); 90 let mut result = Vec::new();
91 for type_arg in type_arg_list.type_args() { 91 for type_arg in type_arg_list.type_args() {
92 let type_arg: ast::TypeArg = type_arg; 92 let type_arg: ast::TypeArg = type_arg;
93 result.push(type_arg.type_ref()?); 93 result.push(type_arg.ty()?);
94 } 94 }
95 Some(result) 95 Some(result)
96 } 96 }
@@ -99,9 +99,9 @@ impl<'a> SubstituteTypeParams<'a> {
99 &self, 99 &self,
100 node: &ra_syntax::SyntaxNode, 100 node: &ra_syntax::SyntaxNode,
101 ) -> Option<ra_syntax::SyntaxNode> { 101 ) -> Option<ra_syntax::SyntaxNode> {
102 let type_ref = ast::TypeRef::cast(node.clone())?; 102 let type_ref = ast::Type::cast(node.clone())?;
103 let path = match &type_ref { 103 let path = match &type_ref {
104 ast::TypeRef::PathType(path_type) => path_type.path()?, 104 ast::Type::PathType(path_type) => path_type.path()?,
105 _ => return None, 105 _ => return None,
106 }; 106 };
107 // FIXME: use `hir::Path::from_src` instead. 107 // FIXME: use `hir::Path::from_src` instead.