From b0fe3d929f6f8764f371970b9f9ca9e7c415dafd Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Sat, 3 Apr 2021 20:22:59 +0200 Subject: Add TyBuilder::unit() and TyExt::is_unit() --- crates/hir_ty/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/hir_ty/src/lib.rs') 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; mod tests; #[cfg(test)] mod test_db; +mod chalk_ext; use std::{iter, mem, sync::Arc}; @@ -42,6 +43,7 @@ use crate::{ }; pub use autoderef::autoderef; +pub use chalk_ext::TyExt; pub use infer::{could_unify, InferenceResult, InferenceVar}; pub use lower::{ associated_type_shorthand_candidates, callable_item_sig, CallableDefId, ImplTraitLoweringMode, @@ -813,14 +815,12 @@ impl TypeWalk for CallableSig { struct TyBuilder {} impl TyBuilder { - -} - -impl Ty { - pub fn unit() -> Self { + pub fn unit() -> Ty { TyKind::Tuple(0, Substitution::empty(&Interner)).intern(&Interner) } +} +impl Ty { pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty { TyKind::Adt(AdtId(adt), substs).intern(&Interner) } -- cgit v1.2.3