diff options
Diffstat (limited to 'crates/ra_hir_def/src/type_ref.rs')
-rw-r--r-- | crates/ra_hir_def/src/type_ref.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_hir_def/src/type_ref.rs b/crates/ra_hir_def/src/type_ref.rs index 4059302df..a5dc10eac 100644 --- a/crates/ra_hir_def/src/type_ref.rs +++ b/crates/ra_hir_def/src/type_ref.rs | |||
@@ -82,7 +82,7 @@ impl TypeRef { | |||
82 | /// Converts an `ast::TypeRef` to a `hir::TypeRef`. | 82 | /// Converts an `ast::TypeRef` to a `hir::TypeRef`. |
83 | pub(crate) fn from_ast(ctx: &LowerCtx, node: ast::TypeRef) -> Self { | 83 | pub(crate) fn from_ast(ctx: &LowerCtx, node: ast::TypeRef) -> Self { |
84 | match node { | 84 | match node { |
85 | ast::TypeRef::ParenType(inner) => TypeRef::from_ast_opt(&ctx, inner.type_ref()), | 85 | ast::TypeRef::ParenType(inner) => TypeRef::from_ast_opt(&ctx, inner.ty()), |
86 | ast::TypeRef::TupleType(inner) => { | 86 | ast::TypeRef::TupleType(inner) => { |
87 | TypeRef::Tuple(inner.fields().map(|it| TypeRef::from_ast(ctx, it)).collect()) | 87 | TypeRef::Tuple(inner.fields().map(|it| TypeRef::from_ast(ctx, it)).collect()) |
88 | } | 88 | } |
@@ -96,18 +96,18 @@ impl TypeRef { | |||
96 | .unwrap_or(TypeRef::Error) | 96 | .unwrap_or(TypeRef::Error) |
97 | } | 97 | } |
98 | ast::TypeRef::PointerType(inner) => { | 98 | ast::TypeRef::PointerType(inner) => { |
99 | let inner_ty = TypeRef::from_ast_opt(&ctx, inner.type_ref()); | 99 | let inner_ty = TypeRef::from_ast_opt(&ctx, inner.ty()); |
100 | let mutability = Mutability::from_mutable(inner.mut_token().is_some()); | 100 | let mutability = Mutability::from_mutable(inner.mut_token().is_some()); |
101 | TypeRef::RawPtr(Box::new(inner_ty), mutability) | 101 | TypeRef::RawPtr(Box::new(inner_ty), mutability) |
102 | } | 102 | } |
103 | ast::TypeRef::ArrayType(inner) => { | 103 | ast::TypeRef::ArrayType(inner) => { |
104 | TypeRef::Array(Box::new(TypeRef::from_ast_opt(&ctx, inner.type_ref()))) | 104 | TypeRef::Array(Box::new(TypeRef::from_ast_opt(&ctx, inner.ty()))) |
105 | } | 105 | } |
106 | ast::TypeRef::SliceType(inner) => { | 106 | ast::TypeRef::SliceType(inner) => { |
107 | TypeRef::Slice(Box::new(TypeRef::from_ast_opt(&ctx, inner.type_ref()))) | 107 | TypeRef::Slice(Box::new(TypeRef::from_ast_opt(&ctx, inner.ty()))) |
108 | } | 108 | } |
109 | ast::TypeRef::ReferenceType(inner) => { | 109 | ast::TypeRef::ReferenceType(inner) => { |
110 | let inner_ty = TypeRef::from_ast_opt(&ctx, inner.type_ref()); | 110 | let inner_ty = TypeRef::from_ast_opt(&ctx, inner.ty()); |
111 | let mutability = Mutability::from_mutable(inner.mut_token().is_some()); | 111 | let mutability = Mutability::from_mutable(inner.mut_token().is_some()); |
112 | TypeRef::Reference(Box::new(inner_ty), mutability) | 112 | TypeRef::Reference(Box::new(inner_ty), mutability) |
113 | } | 113 | } |
@@ -115,7 +115,7 @@ impl TypeRef { | |||
115 | ast::TypeRef::FnPointerType(inner) => { | 115 | ast::TypeRef::FnPointerType(inner) => { |
116 | let ret_ty = inner | 116 | let ret_ty = inner |
117 | .ret_type() | 117 | .ret_type() |
118 | .and_then(|rt| rt.type_ref()) | 118 | .and_then(|rt| rt.ty()) |
119 | .map(|it| TypeRef::from_ast(ctx, it)) | 119 | .map(|it| TypeRef::from_ast(ctx, it)) |
120 | .unwrap_or_else(|| TypeRef::Tuple(Vec::new())); | 120 | .unwrap_or_else(|| TypeRef::Tuple(Vec::new())); |
121 | let mut is_varargs = false; | 121 | let mut is_varargs = false; |
@@ -132,7 +132,7 @@ impl TypeRef { | |||
132 | TypeRef::Fn(params, is_varargs) | 132 | TypeRef::Fn(params, is_varargs) |
133 | } | 133 | } |
134 | // for types are close enough for our purposes to the inner type for now... | 134 | // for types are close enough for our purposes to the inner type for now... |
135 | ast::TypeRef::ForType(inner) => TypeRef::from_ast_opt(&ctx, inner.type_ref()), | 135 | ast::TypeRef::ForType(inner) => TypeRef::from_ast_opt(&ctx, inner.ty()), |
136 | ast::TypeRef::ImplTraitType(inner) => { | 136 | ast::TypeRef::ImplTraitType(inner) => { |
137 | TypeRef::ImplTrait(type_bounds_from_ast(ctx, inner.type_bound_list())) | 137 | TypeRef::ImplTrait(type_bounds_from_ast(ctx, inner.type_bound_list())) |
138 | } | 138 | } |