diff options
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r-- | crates/hir_ty/src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index b6173d87c..fd44efa07 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs | |||
@@ -818,14 +818,8 @@ impl TyBuilder { | |||
818 | pub fn unit() -> Ty { | 818 | pub fn unit() -> Ty { |
819 | TyKind::Tuple(0, Substitution::empty(&Interner)).intern(&Interner) | 819 | TyKind::Tuple(0, Substitution::empty(&Interner)).intern(&Interner) |
820 | } | 820 | } |
821 | } | ||
822 | |||
823 | impl Ty { | ||
824 | pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty { | ||
825 | TyKind::Adt(AdtId(adt), substs).intern(&Interner) | ||
826 | } | ||
827 | 821 | ||
828 | pub fn fn_ptr(sig: CallableSig) -> Self { | 822 | pub fn fn_ptr(sig: CallableSig) -> Ty { |
829 | TyKind::Function(FnPointer { | 823 | TyKind::Function(FnPointer { |
830 | num_args: sig.params().len(), | 824 | num_args: sig.params().len(), |
831 | sig: FnSig { abi: (), safety: Safety::Safe, variadic: sig.is_varargs }, | 825 | sig: FnSig { abi: (), safety: Safety::Safe, variadic: sig.is_varargs }, |
@@ -833,6 +827,12 @@ impl Ty { | |||
833 | }) | 827 | }) |
834 | .intern(&Interner) | 828 | .intern(&Interner) |
835 | } | 829 | } |
830 | } | ||
831 | |||
832 | impl Ty { | ||
833 | pub fn adt_ty(adt: hir_def::AdtId, substs: Substitution) -> Ty { | ||
834 | TyKind::Adt(AdtId(adt), substs).intern(&Interner) | ||
835 | } | ||
836 | 836 | ||
837 | pub fn builtin(builtin: BuiltinType) -> Self { | 837 | pub fn builtin(builtin: BuiltinType) -> Self { |
838 | match builtin { | 838 | match builtin { |