Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/hir-ty/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1473,7 +1473,7 @@ impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
}
TyKind::Foreign(type_alias) => {
let alias = match type_alias {
SolverDefId::ForeignId(id) => id,
SolverDefId::TypeAliasId(id) => id,
_ => unreachable!(),
};
let type_alias = db.type_alias_signature(alias);
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-ty/src/method_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl TyFingerprint {
rustc_ast_ir::Mutability::Not => TyFingerprint::RawPtr(Mutability::Not),
},
TyKind::Foreign(def) => {
let SolverDefId::ForeignId(def) = def else { unreachable!() };
let SolverDefId::TypeAliasId(def) = def else { unreachable!() };
TyFingerprint::ForeignType(crate::to_foreign_def_id(def))
}
TyKind::Dynamic(bounds, _, _) => {
Expand Down
2 changes: 0 additions & 2 deletions crates/hir-ty/src/next_solver/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ pub enum SolverDefId {
StaticId(StaticId),
TraitId(TraitId),
TypeAliasId(TypeAliasId),
ForeignId(TypeAliasId),
InternedClosureId(InternedClosureId),
InternedCoroutineId(InternedCoroutineId),
InternedOpaqueTyId(InternedOpaqueTyId),
Expand Down Expand Up @@ -73,7 +72,6 @@ impl TryFrom<SolverDefId> for GenericDefId {
SolverDefId::StaticId(static_id) => GenericDefId::StaticId(static_id),
SolverDefId::TraitId(trait_id) => GenericDefId::TraitId(trait_id),
SolverDefId::TypeAliasId(type_alias_id) => GenericDefId::TypeAliasId(type_alias_id),
SolverDefId::ForeignId(_) => return Err(value),
SolverDefId::InternedClosureId(_) => return Err(value),
SolverDefId::InternedCoroutineId(_) => return Err(value),
SolverDefId::InternedOpaqueTyId(_) => return Err(value),
Expand Down
1 change: 0 additions & 1 deletion crates/hir-ty/src/next_solver/interner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1148,7 +1148,6 @@ impl<'db> rustc_type_ir::Interner for DbInterner<'db> {
let container = match def_id {
SolverDefId::FunctionId(it) => it.lookup(self.db()).container,
SolverDefId::TypeAliasId(it) => it.lookup(self.db()).container,
SolverDefId::ForeignId(it) => it.lookup(self.db()).container,
SolverDefId::ConstId(it) => it.lookup(self.db()).container,
SolverDefId::InternedClosureId(it) => {
return self
Expand Down
4 changes: 2 additions & 2 deletions crates/hir-ty/src/next_solver/mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl<'db> ChalkToNextSolver<'db, Ty<'db>> for chalk_ir::Ty<Interner> {
)
}
chalk_ir::TyKind::Foreign(foreign_def_id) => rustc_type_ir::TyKind::Foreign(
SolverDefId::ForeignId(crate::from_foreign_def_id(*foreign_def_id)),
SolverDefId::TypeAliasId(crate::from_foreign_def_id(*foreign_def_id)),
),
chalk_ir::TyKind::Error => rustc_type_ir::TyKind::Error(ErrorGuaranteed),
chalk_ir::TyKind::Placeholder(placeholder_index) => {
Expand Down Expand Up @@ -1262,7 +1262,7 @@ pub(crate) fn convert_ty_for_result<'db>(interner: DbInterner<'db>, ty: Ty<'db>)

rustc_type_ir::TyKind::Foreign(foreign) => {
let def_id = match foreign {
SolverDefId::ForeignId(id) => id,
SolverDefId::TypeAliasId(id) => id,
_ => unreachable!(),
};
TyKind::Foreign(to_foreign_def_id(def_id))
Expand Down
Loading