Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index a0237e3b90..14066dee5f 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -3856,6 +3856,11 @@ impl Type {
Type { env: ty.env, ty: TyBuilder::slice(ty.ty) }
}
+ pub fn new_tuple(krate: CrateId, tys: &[Type]) -> Type {
+ let tys = tys.iter().map(|it| it.ty.clone());
+ Type { env: TraitEnvironment::empty(krate), ty: TyBuilder::tuple_with(tys) }
+ }
+
pub fn is_unit(&self) -> bool {
matches!(self.ty.kind(Interner), TyKind::Tuple(0, ..))
}