mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Rename TyKind::ForeignType to Foreign
This commit is contained in:
parent
65c2e51940
commit
72c54c53cd
7 changed files with 10 additions and 10 deletions
|
@ -1900,7 +1900,7 @@ impl Type {
|
||||||
| TyKind::Dyn(_)
|
| TyKind::Dyn(_)
|
||||||
| TyKind::Function(_)
|
| TyKind::Function(_)
|
||||||
| TyKind::Alias(_)
|
| TyKind::Alias(_)
|
||||||
| TyKind::ForeignType(_) => false,
|
| TyKind::Foreign(_) => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -529,7 +529,7 @@ impl HirDisplay for Ty {
|
||||||
projection_ty.hir_fmt(f)?;
|
projection_ty.hir_fmt(f)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TyKind::ForeignType(type_alias) => {
|
TyKind::Foreign(type_alias) => {
|
||||||
let type_alias = f.db.type_alias_data(from_foreign_def_id(*type_alias));
|
let type_alias = f.db.type_alias_data(from_foreign_def_id(*type_alias));
|
||||||
write!(f, "{}", type_alias.name)?;
|
write!(f, "{}", type_alias.name)?;
|
||||||
}
|
}
|
||||||
|
|
|
@ -290,7 +290,7 @@ impl Ty {
|
||||||
Some(db.lookup_intern_callable_def(callable.into()).into())
|
Some(db.lookup_intern_callable_def(callable.into()).into())
|
||||||
}
|
}
|
||||||
TyKind::AssociatedType(type_alias, ..) => Some(from_assoc_type_id(type_alias).into()),
|
TyKind::AssociatedType(type_alias, ..) => Some(from_assoc_type_id(type_alias).into()),
|
||||||
TyKind::ForeignType(type_alias, ..) => Some(from_foreign_def_id(type_alias).into()),
|
TyKind::Foreign(type_alias, ..) => Some(from_foreign_def_id(type_alias).into()),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -312,7 +312,7 @@ impl Ty {
|
||||||
(TyKind::AssociatedType(ty_id, ..), TyKind::AssociatedType(ty_id2, ..)) => {
|
(TyKind::AssociatedType(ty_id, ..), TyKind::AssociatedType(ty_id2, ..)) => {
|
||||||
ty_id == ty_id2
|
ty_id == ty_id2
|
||||||
}
|
}
|
||||||
(TyKind::ForeignType(ty_id, ..), TyKind::ForeignType(ty_id2, ..)) => ty_id == ty_id2,
|
(TyKind::Foreign(ty_id, ..), TyKind::Foreign(ty_id2, ..)) => ty_id == ty_id2,
|
||||||
(TyKind::Closure(id1, _), TyKind::Closure(id2, _)) => id1 == id2,
|
(TyKind::Closure(id1, _), TyKind::Closure(id2, _)) => id1 == id2,
|
||||||
(TyKind::Ref(mutability, ..), TyKind::Ref(mutability2, ..))
|
(TyKind::Ref(mutability, ..), TyKind::Ref(mutability2, ..))
|
||||||
| (TyKind::Raw(mutability, ..), TyKind::Raw(mutability2, ..)) => {
|
| (TyKind::Raw(mutability, ..), TyKind::Raw(mutability2, ..)) => {
|
||||||
|
|
|
@ -1145,7 +1145,7 @@ fn type_for_type_alias(db: &dyn HirDatabase, t: TypeAliasId) -> Binders<Ty> {
|
||||||
let ctx =
|
let ctx =
|
||||||
TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable);
|
TyLoweringContext::new(db, &resolver).with_type_param_mode(TypeParamLoweringMode::Variable);
|
||||||
if db.type_alias_data(t).is_extern {
|
if db.type_alias_data(t).is_extern {
|
||||||
Binders::new(0, TyKind::ForeignType(crate::to_foreign_def_id(t)).intern(&Interner))
|
Binders::new(0, TyKind::Foreign(crate::to_foreign_def_id(t)).intern(&Interner))
|
||||||
} else {
|
} else {
|
||||||
let type_ref = &db.type_alias_data(t).type_ref;
|
let type_ref = &db.type_alias_data(t).type_ref;
|
||||||
let inner = ctx.lower_ty(type_ref.as_deref().unwrap_or(&TypeRef::Error));
|
let inner = ctx.lower_ty(type_ref.as_deref().unwrap_or(&TypeRef::Error));
|
||||||
|
|
|
@ -55,7 +55,7 @@ impl TyFingerprint {
|
||||||
TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(adt),
|
TyKind::Adt(AdtId(adt), _) => TyFingerprint::Adt(adt),
|
||||||
TyKind::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality),
|
TyKind::Tuple(cardinality, _) => TyFingerprint::Tuple(cardinality),
|
||||||
TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability),
|
TyKind::Raw(mutability, ..) => TyFingerprint::RawPtr(mutability),
|
||||||
TyKind::ForeignType(alias_id, ..) => TyFingerprint::ForeignType(alias_id),
|
TyKind::Foreign(alias_id, ..) => TyFingerprint::ForeignType(alias_id),
|
||||||
TyKind::Function(FnPointer { num_args, sig, .. }) => {
|
TyKind::Function(FnPointer { num_args, sig, .. }) => {
|
||||||
TyFingerprint::FnPtr(num_args, sig)
|
TyFingerprint::FnPtr(num_args, sig)
|
||||||
}
|
}
|
||||||
|
@ -246,7 +246,7 @@ impl Ty {
|
||||||
TyKind::Adt(AdtId(def_id), _) => {
|
TyKind::Adt(AdtId(def_id), _) => {
|
||||||
return mod_to_crate_ids(def_id.module(db.upcast()));
|
return mod_to_crate_ids(def_id.module(db.upcast()));
|
||||||
}
|
}
|
||||||
TyKind::ForeignType(id) => {
|
TyKind::Foreign(id) => {
|
||||||
return mod_to_crate_ids(
|
return mod_to_crate_ids(
|
||||||
from_foreign_def_id(*id).lookup(db.upcast()).module(db.upcast()),
|
from_foreign_def_id(*id).lookup(db.upcast()).module(db.upcast()),
|
||||||
);
|
);
|
||||||
|
|
|
@ -43,7 +43,7 @@ impl ToChalk for Ty {
|
||||||
chalk_ir::TyKind::OpaqueType(id, substitution).intern(&Interner)
|
chalk_ir::TyKind::OpaqueType(id, substitution).intern(&Interner)
|
||||||
}
|
}
|
||||||
|
|
||||||
TyKind::ForeignType(id) => chalk_ir::TyKind::Foreign(id).intern(&Interner),
|
TyKind::Foreign(id) => chalk_ir::TyKind::Foreign(id).intern(&Interner),
|
||||||
|
|
||||||
TyKind::Scalar(scalar) => chalk_ir::TyKind::Scalar(scalar).intern(&Interner),
|
TyKind::Scalar(scalar) => chalk_ir::TyKind::Scalar(scalar).intern(&Interner),
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ impl ToChalk for Ty {
|
||||||
|
|
||||||
chalk_ir::TyKind::Closure(id, subst) => TyKind::Closure(id, from_chalk(db, subst)),
|
chalk_ir::TyKind::Closure(id, subst) => TyKind::Closure(id, from_chalk(db, subst)),
|
||||||
|
|
||||||
chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::ForeignType(foreign_def_id),
|
chalk_ir::TyKind::Foreign(foreign_def_id) => TyKind::Foreign(foreign_def_id),
|
||||||
chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME
|
chalk_ir::TyKind::Generator(_, _) => unimplemented!(), // FIXME
|
||||||
chalk_ir::TyKind::GeneratorWitness(_, _) => unimplemented!(), // FIXME
|
chalk_ir::TyKind::GeneratorWitness(_, _) => unimplemented!(), // FIXME
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,7 @@ pub enum TyKind {
|
||||||
Closure(ClosureId, Substitution),
|
Closure(ClosureId, Substitution),
|
||||||
|
|
||||||
/// Represents a foreign type declared in external blocks.
|
/// Represents a foreign type declared in external blocks.
|
||||||
ForeignType(ForeignDefId),
|
Foreign(ForeignDefId),
|
||||||
|
|
||||||
/// A pointer to a function. Written as `fn() -> i32`.
|
/// A pointer to a function. Written as `fn() -> i32`.
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue