aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty')
-rw-r--r--crates/hir_ty/src/display.rs2
-rw-r--r--crates/hir_ty/src/lib.rs4
-rw-r--r--crates/hir_ty/src/lower.rs2
-rw-r--r--crates/hir_ty/src/method_resolution.rs4
-rw-r--r--crates/hir_ty/src/traits/chalk/mapping.rs4
-rw-r--r--crates/hir_ty/src/types.rs2
6 files changed, 9 insertions, 9 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 83d09a8c7..5ff70c893 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -529,7 +529,7 @@ impl HirDisplay for Ty {
529 projection_ty.hir_fmt(f)?; 529 projection_ty.hir_fmt(f)?;
530 } 530 }
531 } 531 }
532 TyKind::ForeignType(type_alias) => { 532 TyKind::Foreign(type_alias) => {
533 let type_alias = f.db.type_alias_data(from_foreign_def_id(*type_alias)); 533 let type_alias = f.db.type_alias_data(from_foreign_def_id(*type_alias));
534 write!(f, "{}", type_alias.name)?; 534 write!(f, "{}", type_alias.name)?;
535 } 535 }
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 9e030e775..d1513df1f 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -290,7 +290,7 @@ impl Ty {
290 Some(db.lookup_intern_callable_def(callable.into()).into()) 290 Some(db.lookup_intern_callable_def(callable.into()).into())
291 } 291 }
292 TyKind::AssociatedType(type_alias, ..) => Some(from_assoc_type_id(type_alias).into()), 292 TyKind::AssociatedType(type_alias, ..) => Some(from_assoc_type_id(type_alias).into()),
293 TyKind::ForeignType(type_alias, ..) => Some(from_foreign_def_id(type_alias).into()), 293 TyKind::Foreign(type_alias, ..) => Some(from_foreign_def_id(type_alias).into()),
294 _ => None, 294 _ => None,
295 } 295 }
296 } 296 }
@@ -312,7 +312,7 @@ impl Ty {
312 (TyKind::AssociatedType(ty_id, ..), TyKind::AssociatedType(ty_id2, ..)) => { 312 (TyKind::AssociatedType(ty_id, ..), TyKind::AssociatedType(ty_id2, ..)) => {
313 ty_id == ty_id2 313 ty_id == ty_id2
314 } 314 }
315 (TyKind::ForeignType(ty_id, ..), TyKind::ForeignType(ty_id2, ..)) => ty_id == ty_id2, 315 (TyKind::Foreign(ty_id, ..), TyKind::Foreign(ty_id2, ..)) => ty_id == ty_id2,
316 (TyKind::Closure(id1, _), TyKind::Closure(id2, _)) => id1 == id2, 316 (TyKind::Closure(id1, _), TyKind::Closure(id2, _)) => id1 == id2,
317 (TyKind::Ref(mutability, ..), TyKind::Ref(mutability2, ..)) 317 (TyKind::Ref(mutability, ..), TyKind::Ref(mutability2, ..))
318 | (TyKind::Raw(mutability, ..), TyKind::Raw(mutability2, ..)) => { 318 | (TyKind::Raw(mutability, ..), TyKind::Raw(mutability2, ..)) => {
diff --git a/crates/hir_ty/src/lower.rs b/crates/hir_ty/src/lower.rs
index dd40eb5c3..ba48be4ad 100644
--- a/crates/hir_ty/src/lower.rs
+++ b/crates/hir_ty/src/lower.rs
@@ -1145,7 +1145,7 @@ fn type_for_type_alias(db: &dyn HirDatabase, t: TypeAliasId) -> Binders<Ty> {
1145 let ctx = 1145 let ctx =
1146 TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable); 1146 TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable);
1147 if db.type_alias_data(t).is_extern { 1147 if db.type_alias_data(t).is_extern {
1148 Binders::new(0, TyKind::ForeignType(crate::to_foreign_def_id(t)).intern(&Interner)) 1148 Binders::new(0, TyKind::Foreign(crate::to_foreign_def_id(t)).intern(&Interner))
1149 } else { 1149 } else {
1150 let type_ref = &db.type_alias_data(t).type_ref; 1150 let type_ref = &db.type_alias_data(t).type_ref;
1151 let inner = ctx.lower_ty(type_ref.as_deref().unwrap_or(&TypeRef::Error)); 1151 let inner = ctx.lower_ty(type_ref.as_deref().unwrap_or(&TypeRef::Error));
diff --git a/crates/hir_ty/src/method_resolution.rs b/crates/hir_ty/src/method_resolution.rs
index dc6324780..6ace970d1 100644
--- a/crates/hir_ty/src/method_resolution.rs
+++ b/crates/hir_ty/src/method_resolution.rs
@@ -55,7 +55,7 @@ impl TyFingerprint {
55 TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(adt), 55 TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(adt),
56 TyKind::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality), 56 TyKind::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality),
57 TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability), 57 TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability),
58 TyKind::ForeignType(alias_id, ..) => TyFingerprint::ForeignType(alias_id), 58 TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(alias_id),
59 TyKind::Function(FnPointer { num_args, sig, .. }) => { 59 TyKind::Function(FnPointer { num_args, sig, .. }) => {
60 TyFingerprint::FnPtr(num_args, sig) 60 TyFingerprint::FnPtr(num_args, sig)
61 } 61 }
@@ -246,7 +246,7 @@ impl Ty {
246 TyKind::Adt(AdtId(def_id), _) => { 246 TyKind::Adt(AdtId(def_id), _) => {
247 return mod_to_crate_ids(def_id.module(db.upcast())); 247 return mod_to_crate_ids(def_id.module(db.upcast()));
248 } 248 }
249 TyKind::ForeignType(id) => { 249 TyKind::Foreign(id) => {
250 return mod_to_crate_ids( 250 return mod_to_crate_ids(
251 from_foreign_def_id(*id).lookup(db.upcast()).module(db.upcast()), 251 from_foreign_def_id(*id).lookup(db.upcast()).module(db.upcast()),
252 ); 252 );
diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs
index c5654f17b..59aaa5560 100644
--- a/crates/hir_ty/src/traits/chalk/mapping.rs
+++ b/crates/hir_ty/src/traits/chalk/mapping.rs
@@ -43,7 +43,7 @@ impl ToChalk for Ty {
43 chalk_ir::TyKind::OpaqueType(id, substitution).intern(&Interner) 43 chalk_ir::TyKind::OpaqueType(id, substitution).intern(&Interner)
44 } 44 }
45 45
46 TyKind::ForeignType(id) => chalk_ir::TyKind::Foreign(id).intern(&Interner), 46 TyKind::Foreign(id) => chalk_ir::TyKind::Foreign(id).intern(&Interner),
47 47
48 TyKind::Scalar(scalar) => chalk_ir::TyKind::Scalar(scalar).intern(&Interner), 48 TyKind::Scalar(scalar) => chalk_ir::TyKind::Scalar(scalar).intern(&Interner),
49 49
@@ -181,7 +181,7 @@ impl ToChalk for Ty {
181 181
182 chalk_ir::TyKind::Closure(id, subst) => TyKind::Closure(id, from_chalk(db, subst)), 182 chalk_ir::TyKind::Closure(id, subst) => TyKind::Closure(id, from_chalk(db, subst)),
183 183
184 chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::ForeignType(foreign_def_id), 184 chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::Foreign(foreign_def_id),
185 chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME 185 chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME
186 chalk_ir::TyKind::GeneratorWitness(_, _) => unimplemented!(), // FIXME 186 chalk_ir::TyKind::GeneratorWitness(_, _) => unimplemented!(), // FIXME
187 } 187 }
diff --git a/crates/hir_ty/src/types.rs b/crates/hir_ty/src/types.rs
index 9853ab3be..bac086318 100644
--- a/crates/hir_ty/src/types.rs
+++ b/crates/hir_ty/src/types.rs
@@ -132,7 +132,7 @@ pub enum TyKind {
132 Closure(ClosureId, Substitution), 132 Closure(ClosureId, Substitution),
133 133
134 /// Represents a foreign type declared in external blocks. 134 /// Represents a foreign type declared in external blocks.
135 ForeignType(ForeignDefId), 135 Foreign(ForeignDefId),
136 136
137 /// A pointer to a function. Written as `fn() -> i32`. 137 /// A pointer to a function. Written as `fn() -> i32`.
138 /// 138 ///