aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/item_tree
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-30 20:02:55 +0100
committerAleksey Kladov <[email protected]>2020-07-30 20:02:55 +0100
commitf95f425ae4199e814e6956be1d9bb59a14758c07 (patch)
treedd3503a2be3a6699a6b111844dbcdc85b37e2425 /crates/ra_hir_def/src/item_tree
parent2e2642efccd5855e4158b01a006e7884a96982bb (diff)
Use ty to access most TypeRefs
Diffstat (limited to 'crates/ra_hir_def/src/item_tree')
-rw-r--r--crates/ra_hir_def/src/item_tree/lower.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_hir_def/src/item_tree/lower.rs b/crates/ra_hir_def/src/item_tree/lower.rs
index f0ced1f79..feb31579e 100644
--- a/crates/ra_hir_def/src/item_tree/lower.rs
+++ b/crates/ra_hir_def/src/item_tree/lower.rs
@@ -228,7 +228,7 @@ impl Ctx {
228 fn lower_tuple_field(&mut self, idx: usize, field: &ast::TupleField) -> Field { 228 fn lower_tuple_field(&mut self, idx: usize, field: &ast::TupleField) -> Field {
229 let name = Name::new_tuple_field(idx); 229 let name = Name::new_tuple_field(idx);
230 let visibility = self.lower_visibility(field); 230 let visibility = self.lower_visibility(field);
231 let type_ref = self.lower_type_ref_opt(field.type_ref()); 231 let type_ref = self.lower_type_ref_opt(field.ty());
232 let res = Field { name, type_ref, visibility }; 232 let res = Field { name, type_ref, visibility };
233 res 233 res
234 } 234 }
@@ -317,7 +317,7 @@ impl Ctx {
317 } 317 }
318 } 318 }
319 319
320 let ret_type = match func.ret_type().and_then(|rt| rt.type_ref()) { 320 let ret_type = match func.ret_type().and_then(|rt| rt.ty()) {
321 Some(type_ref) => TypeRef::from_ast(&self.body_ctx, type_ref), 321 Some(type_ref) => TypeRef::from_ast(&self.body_ctx, type_ref),
322 _ => TypeRef::unit(), 322 _ => TypeRef::unit(),
323 }; 323 };
@@ -352,7 +352,7 @@ impl Ctx {
352 type_alias: &ast::TypeAlias, 352 type_alias: &ast::TypeAlias,
353 ) -> Option<FileItemTreeId<TypeAlias>> { 353 ) -> Option<FileItemTreeId<TypeAlias>> {
354 let name = type_alias.name()?.as_name(); 354 let name = type_alias.name()?.as_name();
355 let type_ref = type_alias.type_ref().map(|it| self.lower_type_ref(&it)); 355 let type_ref = type_alias.ty().map(|it| self.lower_type_ref(&it));
356 let visibility = self.lower_visibility(type_alias); 356 let visibility = self.lower_visibility(type_alias);
357 let bounds = self.lower_type_bounds(type_alias); 357 let bounds = self.lower_type_bounds(type_alias);
358 let generic_params = self.lower_generic_params(GenericsOwner::TypeAlias, type_alias); 358 let generic_params = self.lower_generic_params(GenericsOwner::TypeAlias, type_alias);