diff options
Diffstat (limited to 'crates/ra_hir_def/src/path')
-rw-r--r-- | crates/ra_hir_def/src/path/lower.rs | 10 | ||||
-rw-r--r-- | crates/ra_hir_def/src/path/lower/lower_use.rs | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/ra_hir_def/src/path/lower.rs b/crates/ra_hir_def/src/path/lower.rs index 6a0c019fd..257f9a033 100644 --- a/crates/ra_hir_def/src/path/lower.rs +++ b/crates/ra_hir_def/src/path/lower.rs | |||
@@ -9,7 +9,7 @@ use hir_expand::{ | |||
9 | hygiene::Hygiene, | 9 | hygiene::Hygiene, |
10 | name::{name, AsName}, | 10 | name::{name, AsName}, |
11 | }; | 11 | }; |
12 | use ra_syntax::ast::{self, AstNode, TypeAscriptionOwner, TypeBoundsOwner}; | 12 | use ra_syntax::ast::{self, AstNode, TypeBoundsOwner}; |
13 | 13 | ||
14 | use super::AssociatedTypeBinding; | 14 | use super::AssociatedTypeBinding; |
15 | use crate::{ | 15 | use crate::{ |
@@ -152,7 +152,7 @@ pub(super) fn lower_generic_args( | |||
152 | ) -> Option<GenericArgs> { | 152 | ) -> Option<GenericArgs> { |
153 | let mut args = Vec::new(); | 153 | let mut args = Vec::new(); |
154 | for type_arg in node.type_args() { | 154 | for type_arg in node.type_args() { |
155 | let type_ref = TypeRef::from_ast_opt(lower_ctx, type_arg.type_ref()); | 155 | let type_ref = TypeRef::from_ast_opt(lower_ctx, type_arg.ty()); |
156 | args.push(GenericArg::Type(type_ref)); | 156 | args.push(GenericArg::Type(type_ref)); |
157 | } | 157 | } |
158 | // lifetimes ignored for now | 158 | // lifetimes ignored for now |
@@ -161,7 +161,7 @@ pub(super) fn lower_generic_args( | |||
161 | let assoc_type_arg: ast::AssocTypeArg = assoc_type_arg; | 161 | let assoc_type_arg: ast::AssocTypeArg = assoc_type_arg; |
162 | if let Some(name_ref) = assoc_type_arg.name_ref() { | 162 | if let Some(name_ref) = assoc_type_arg.name_ref() { |
163 | let name = name_ref.as_name(); | 163 | let name = name_ref.as_name(); |
164 | let type_ref = assoc_type_arg.type_ref().map(|it| TypeRef::from_ast(lower_ctx, it)); | 164 | let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it)); |
165 | let bounds = if let Some(l) = assoc_type_arg.type_bound_list() { | 165 | let bounds = if let Some(l) = assoc_type_arg.type_bound_list() { |
166 | l.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect() | 166 | l.bounds().map(|it| TypeBound::from_ast(lower_ctx, it)).collect() |
167 | } else { | 167 | } else { |
@@ -189,14 +189,14 @@ fn lower_generic_args_from_fn_path( | |||
189 | if let Some(params) = params { | 189 | if let Some(params) = params { |
190 | let mut param_types = Vec::new(); | 190 | let mut param_types = Vec::new(); |
191 | for param in params.params() { | 191 | for param in params.params() { |
192 | let type_ref = TypeRef::from_ast_opt(&ctx, param.ascribed_type()); | 192 | let type_ref = TypeRef::from_ast_opt(&ctx, param.ty()); |
193 | param_types.push(type_ref); | 193 | param_types.push(type_ref); |
194 | } | 194 | } |
195 | let arg = GenericArg::Type(TypeRef::Tuple(param_types)); | 195 | let arg = GenericArg::Type(TypeRef::Tuple(param_types)); |
196 | args.push(arg); | 196 | args.push(arg); |
197 | } | 197 | } |
198 | if let Some(ret_type) = ret_type { | 198 | if let Some(ret_type) = ret_type { |
199 | let type_ref = TypeRef::from_ast_opt(&ctx, ret_type.type_ref()); | 199 | let type_ref = TypeRef::from_ast_opt(&ctx, ret_type.ty()); |
200 | bindings.push(AssociatedTypeBinding { | 200 | bindings.push(AssociatedTypeBinding { |
201 | name: name![Output], | 201 | name: name![Output], |
202 | type_ref: Some(type_ref), | 202 | type_ref: Some(type_ref), |
diff --git a/crates/ra_hir_def/src/path/lower/lower_use.rs b/crates/ra_hir_def/src/path/lower/lower_use.rs index 7cc655487..794be45e8 100644 --- a/crates/ra_hir_def/src/path/lower/lower_use.rs +++ b/crates/ra_hir_def/src/path/lower/lower_use.rs | |||
@@ -31,7 +31,7 @@ pub(crate) fn lower_use_tree( | |||
31 | lower_use_tree(prefix.clone(), child_tree, hygiene, cb); | 31 | lower_use_tree(prefix.clone(), child_tree, hygiene, cb); |
32 | } | 32 | } |
33 | } else { | 33 | } else { |
34 | let alias = tree.alias().map(|a| { | 34 | let alias = tree.rename().map(|a| { |
35 | a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) | 35 | a.name().map(|it| it.as_name()).map_or(ImportAlias::Underscore, ImportAlias::Alias) |
36 | }); | 36 | }); |
37 | let is_glob = tree.star_token().is_some(); | 37 | let is_glob = tree.star_token().is_some(); |