diff options
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index a8ddb43f5..b6173d87c 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -23,6 +23,7 @@ pub mod diagnostics; | |||
23 | mod tests; | 23 | mod tests; |
24 | #[cfg(test)] | 24 | #[cfg(test)] |
25 | mod test_db; | 25 | mod test_db; |
26 | mod chalk_ext; | ||
26 | 27 | ||
27 | use std::{iter, mem, sync::Arc}; | 28 | use std::{iter, mem, sync::Arc}; |
28 | 29 | ||
@@ -42,6 +43,7 @@ use crate::{ | |||
42 | }; | 43 | }; |
43 | 44 | ||
44 | pub use autoderef::autoderef; | 45 | pub use autoderef::autoderef; |
46 | pub use chalk_ext::TyExt; | ||
45 | pub use infer::{could_unify, InferenceResult, InferenceVar}; | 47 | pub use infer::{could_unify, InferenceResult, InferenceVar}; |
46 | pub use lower::{ | 48 | pub use lower::{ |
47 | associated_type_shorthand_candidates, callable_item_sig, CallableDefId, ImplTraitLoweringMode, | 49 | associated_type_shorthand_candidates, callable_item_sig, CallableDefId, ImplTraitLoweringMode, |
@@ -813,14 +815,12 @@ impl TypeWalk for CallableSig { | |||
813 | struct TyBuilder {} | 815 | struct TyBuilder {} |
814 | 816 | ||
815 | impl TyBuilder { | 817 | impl TyBuilder { |
816 | 818 | pub fn unit() -> Ty { | |
817 | } | ||
818 | |||
819 | impl Ty { | ||
820 | pub fn unit() -> Self { | ||
821 | TyKind::Tuple(0, Substitution::empty(&Interner)).intern(&Interner) | 819 | TyKind::Tuple(0, Substitution::empty(&Interner)).intern(&Interner) |
822 | } | 820 | } |
821 | } | ||
823 | 822 | ||
823 | impl Ty { | ||
824 | pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty { | 824 | pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty { |
825 | TyKind::Adt(AdtId(adt), substs).intern(&Interner) | 825 | TyKind::Adt(AdtId(adt), substs).intern(&Interner) |
826 | } | 826 | } |