From 9719ce9fc731a400c9744ba1a6569e978c1a97e7 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 13 Mar 2021 17:55:50 +0100 Subject: Use chalk_ir::FnDefId --- crates/hir_ty/src/traits/chalk.rs | 4 ++-- crates/hir_ty/src/traits/chalk/interner.rs | 1 - crates/hir_ty/src/traits/chalk/mapping.rs | 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'crates/hir_ty/src/traits') diff --git a/crates/hir_ty/src/traits/chalk.rs b/crates/hir_ty/src/traits/chalk.rs index 2d3cd6719..bb92d8e2a 100644 --- a/crates/hir_ty/src/traits/chalk.rs +++ b/crates/hir_ty/src/traits/chalk.rs @@ -21,8 +21,8 @@ use crate::{ method_resolution::{TyFingerprint, ALL_FLOAT_FPS, ALL_INT_FPS}, to_assoc_type_id, utils::generics, - BoundVar, CallableDefId, CallableSig, DebruijnIndex, GenericPredicate, ProjectionPredicate, - ProjectionTy, Substs, TraitRef, Ty, TyKind, + BoundVar, CallableDefId, CallableSig, DebruijnIndex, FnDefId, GenericPredicate, + ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TyKind, }; use mapping::{ convert_where_clauses, generic_predicate_to_inline_bound, make_binders, TypeAliasAsValue, diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs index e891efb7b..1dc3f497d 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs @@ -20,7 +20,6 @@ pub(crate) type ImplId = chalk_ir::ImplId; pub(crate) type ImplDatum = chalk_solve::rust_ir::ImplDatum; pub(crate) type AssociatedTyValueId = chalk_solve::rust_ir::AssociatedTyValueId; pub(crate) type AssociatedTyValue = chalk_solve::rust_ir::AssociatedTyValue; -pub(crate) type FnDefId = chalk_ir::FnDefId; pub(crate) type FnDefDatum = chalk_solve::rust_ir::FnDefDatum; pub(crate) type OpaqueTyId = chalk_ir::OpaqueTyId; pub(crate) type OpaqueTyDatum = chalk_solve::rust_ir::OpaqueTyDatum; diff --git a/crates/hir_ty/src/traits/chalk/mapping.rs b/crates/hir_ty/src/traits/chalk/mapping.rs index 67ac95a0e..23ef07d77 100644 --- a/crates/hir_ty/src/traits/chalk/mapping.rs +++ b/crates/hir_ty/src/traits/chalk/mapping.rs @@ -66,8 +66,7 @@ impl ToChalk for Ty { chalk_ir::TyKind::Slice(substs[0].clone().to_chalk(db)).intern(&Interner) } TyKind::Str => chalk_ir::TyKind::Str.intern(&Interner), - TyKind::FnDef(callable_def, substs) => { - let id = callable_def.to_chalk(db); + TyKind::FnDef(id, substs) => { let substitution = substs.to_chalk(db); chalk_ir::TyKind::FnDef(id, substitution).intern(&Interner) } @@ -201,7 +200,7 @@ impl ToChalk for Ty { chalk_ir::TyKind::Never => TyKind::Never, chalk_ir::TyKind::FnDef(fn_def_id, subst) => { - TyKind::FnDef(from_chalk(db, fn_def_id), from_chalk(db, subst)) + TyKind::FnDef(fn_def_id, from_chalk(db, subst)) } chalk_ir::TyKind::Closure(id, subst) => { -- cgit v1.2.3