aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/interner.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-09 13:15:26 +0100
committerFlorian Diebold <[email protected]>2021-04-09 13:15:26 +0100
commit5ca481bbdc75bd3a9dbce4c94b014bd0eb8bd9e8 (patch)
treebff5670807fd0cd9ce5d5f6ffaedf0c90ca02c51 /crates/hir_ty/src/interner.rs
parent743faa21e74cc5b627935e2c4c3365807a5c722f (diff)
Move ToChalk -> mapping
Diffstat (limited to 'crates/hir_ty/src/interner.rs')
-rw-r--r--crates/hir_ty/src/interner.rs17
1 files changed, 13 insertions, 4 deletions
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 @@
1//! Implementation of the Chalk `Interner` trait, which allows customizing the 1//! Implementation of the Chalk `Interner` trait, which allows customizing the
2//! representation of the various objects Chalk deals with (types, goals etc.). 2//! representation of the various objects Chalk deals with (types, goals etc.).
3 3
4use crate::{GenericArg, tls, chalk_db}; 4use crate::{chalk_db, tls, GenericArg};
5use base_db::salsa::InternId; 5use base_db::salsa::InternId;
6use chalk_ir::{Goal, GoalData}; 6use chalk_ir::{Goal, GoalData};
7use hir_def::{ 7use hir_def::{
@@ -60,15 +60,24 @@ impl chalk_ir::interner::Interner for Interner {
60 type Identifier = TypeAliasId; 60 type Identifier = TypeAliasId;
61 type FnAbi = (); 61 type FnAbi = ();
62 62
63 fn debug_adt_id(type_kind_id: chalk_db::AdtId, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { 63 fn debug_adt_id(
64 type_kind_id: chalk_db::AdtId,
65 fmt: &mut fmt::Formatter<'_>,
66 ) -> Option<fmt::Result> {
64 tls::with_current_program(|prog| Some(prog?.debug_struct_id(type_kind_id, fmt))) 67 tls::with_current_program(|prog| Some(prog?.debug_struct_id(type_kind_id, fmt)))
65 } 68 }
66 69
67 fn debug_trait_id(type_kind_id: chalk_db::TraitId, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { 70 fn debug_trait_id(
71 type_kind_id: chalk_db::TraitId,
72 fmt: &mut fmt::Formatter<'_>,
73 ) -> Option<fmt::Result> {
68 tls::with_current_program(|prog| Some(prog?.debug_trait_id(type_kind_id, fmt))) 74 tls::with_current_program(|prog| Some(prog?.debug_trait_id(type_kind_id, fmt)))
69 } 75 }
70 76
71 fn debug_assoc_type_id(id: chalk_db::AssocTypeId, fmt: &mut fmt::Formatter<'_>) -> Option<fmt::Result> { 77 fn debug_assoc_type_id(
78 id: chalk_db::AssocTypeId,
79 fmt: &mut fmt::Formatter<'_>,
80 ) -> Option<fmt::Result> {
72 tls::with_current_program(|prog| Some(prog?.debug_assoc_type_id(id, fmt))) 81 tls::with_current_program(|prog| Some(prog?.debug_assoc_type_id(id, fmt)))
73 } 82 }
74 83