From 5ca481bbdc75bd3a9dbce4c94b014bd0eb8bd9e8 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 9 Apr 2021 14:15:26 +0200 Subject: Move ToChalk -> mapping --- crates/hir_ty/src/interner.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'crates/hir_ty/src/interner.rs') diff --git a/crates/hir_ty/src/interner.rs b/crates/hir_ty/src/interner.rs index 0187767ce..02e26c04e 100644 --- a/crates/hir_ty/src/interner.rs +++ b/crates/hir_ty/src/interner.rs @@ -1,7 +1,7 @@ //! Implementation of the Chalk `Interner` trait, which allows customizing the //! representation of the various objects Chalk deals with (types, goals etc.). -use crate::{GenericArg, tls, chalk_db}; +use crate::{chalk_db, tls, GenericArg}; use base_db::salsa::InternId; use chalk_ir::{Goal, GoalData}; use hir_def::{ @@ -60,15 +60,24 @@ impl chalk_ir::interner::Interner for Interner { type Identifier = TypeAliasId; type FnAbi = (); - fn debug_adt_id(type_kind_id: chalk_db::AdtId, fmt: &mut fmt::Formatter<'_>) -> Option { + fn debug_adt_id( + type_kind_id: chalk_db::AdtId, + fmt: &mut fmt::Formatter<'_>, + ) -> Option { tls::with_current_program(|prog| Some(prog?.debug_struct_id(type_kind_id, fmt))) } - fn debug_trait_id(type_kind_id: chalk_db::TraitId, fmt: &mut fmt::Formatter<'_>) -> Option { + fn debug_trait_id( + type_kind_id: chalk_db::TraitId, + fmt: &mut fmt::Formatter<'_>, + ) -> Option { tls::with_current_program(|prog| Some(prog?.debug_trait_id(type_kind_id, fmt))) } - fn debug_assoc_type_id(id: chalk_db::AssocTypeId, fmt: &mut fmt::Formatter<'_>) -> Option { + fn debug_assoc_type_id( + id: chalk_db::AssocTypeId, + fmt: &mut fmt::Formatter<'_>, + ) -> Option { tls::with_current_program(|prog| Some(prog?.debug_assoc_type_id(id, fmt))) } -- cgit v1.2.3