aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/lower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_ty/src/lower.rs')
-rw-r--r--crates/ra_hir_ty/src/lower.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/crates/ra_hir_ty/src/lower.rs b/crates/ra_hir_ty/src/lower.rs
index 3af8d55a1..101b8aebe 100644
--- a/crates/ra_hir_ty/src/lower.rs
+++ b/crates/ra_hir_ty/src/lower.rs
@@ -5,10 +5,7 @@
5//! - Building the type for an item: This happens through the `type_for_def` query. 5//! - Building the type for an item: This happens through the `type_for_def` query.
6//! 6//!
7//! This usually involves resolving names, collecting generic arguments etc. 7//! This usually involves resolving names, collecting generic arguments etc.
8use std::iter; 8use std::{iter, sync::Arc};
9use std::sync::Arc;
10
11use smallvec::SmallVec;
12 9
13use hir_def::{ 10use hir_def::{
14 adt::StructKind, 11 adt::StructKind,
@@ -24,6 +21,8 @@ use hir_def::{
24use hir_expand::name::Name; 21use hir_expand::name::Name;
25use ra_arena::map::ArenaMap; 22use ra_arena::map::ArenaMap;
26use ra_db::CrateId; 23use ra_db::CrateId;
24use smallvec::SmallVec;
25use stdx::impl_from;
27use test_utils::mark; 26use test_utils::mark;
28 27
29use crate::{ 28use crate::{
@@ -1110,7 +1109,7 @@ pub enum CallableDef {
1110 StructId(StructId), 1109 StructId(StructId),
1111 EnumVariantId(EnumVariantId), 1110 EnumVariantId(EnumVariantId),
1112} 1111}
1113impl_froms!(CallableDef: FunctionId, StructId, EnumVariantId); 1112impl_from!(FunctionId, StructId, EnumVariantId for CallableDef);
1114 1113
1115impl CallableDef { 1114impl CallableDef {
1116 pub fn krate(self, db: &dyn HirDatabase) -> CrateId { 1115 pub fn krate(self, db: &dyn HirDatabase) -> CrateId {
@@ -1140,7 +1139,7 @@ pub enum TyDefId {
1140 AdtId(AdtId), 1139 AdtId(AdtId),
1141 TypeAliasId(TypeAliasId), 1140 TypeAliasId(TypeAliasId),
1142} 1141}
1143impl_froms!(TyDefId: BuiltinType, AdtId(StructId, EnumId, UnionId), TypeAliasId); 1142impl_from!(BuiltinType, AdtId(StructId, EnumId, UnionId), TypeAliasId for TyDefId);
1144 1143
1145#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] 1144#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
1146pub enum ValueTyDefId { 1145pub enum ValueTyDefId {
@@ -1150,7 +1149,7 @@ pub enum ValueTyDefId {
1150 ConstId(ConstId), 1149 ConstId(ConstId),
1151 StaticId(StaticId), 1150 StaticId(StaticId),
1152} 1151}
1153impl_froms!(ValueTyDefId: FunctionId, StructId, EnumVariantId, ConstId, StaticId); 1152impl_from!(FunctionId, StructId, EnumVariantId, ConstId, StaticId for ValueTyDefId);
1154 1153
1155/// Build the declared type of an item. This depends on the namespace; e.g. for 1154/// Build the declared type of an item. This depends on the namespace; e.g. for
1156/// `struct Foo(usize)`, we have two types: The type of the struct itself, and 1155/// `struct Foo(usize)`, we have two types: The type of the struct itself, and