From a3f5491a1a312393429a44028e7496fe0a12f8c2 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Sun, 28 Feb 2021 19:13:37 +0100 Subject: Inline TypeCtor into Ty --- crates/hir_ty/src/infer.rs | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'crates/hir_ty/src/infer.rs') diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs index 657f011d2..a1769729f 100644 --- a/crates/hir_ty/src/infer.rs +++ b/crates/hir_ty/src/infer.rs @@ -38,7 +38,7 @@ use syntax::SmolStr; use super::{ primitive::{FloatTy, IntTy}, traits::{Guidance, Obligation, ProjectionPredicate, Solution}, - InEnvironment, ProjectionTy, Substs, TraitEnvironment, TraitRef, Ty, TypeCtor, TypeWalk, + InEnvironment, ProjectionTy, Substs, TraitEnvironment, TraitRef, Ty, TypeWalk, }; use crate::{ db::HirDatabase, infer::diagnostics::InferenceDiagnostic, lower::ImplTraitLoweringMode, Scalar, @@ -46,15 +46,6 @@ use crate::{ pub(crate) use unify::unify; -macro_rules! ty_app { - ($ctor:pat, $param:pat) => { - crate::Ty::Apply(crate::ApplicationTy { ctor: $ctor, parameters: $param }) - }; - ($ctor:pat) => { - ty_app!($ctor, _) - }; -} - mod unify; mod path; mod expr; @@ -684,9 +675,9 @@ impl InferTy { fn fallback_value(self) -> Ty { match self { InferTy::TypeVar(..) => Ty::Unknown, - InferTy::IntVar(..) => Ty::simple(TypeCtor::Scalar(Scalar::Int(IntTy::I32))), - InferTy::FloatVar(..) => Ty::simple(TypeCtor::Scalar(Scalar::Float(FloatTy::F64))), - InferTy::MaybeNeverTypeVar(..) => Ty::simple(TypeCtor::Never), + InferTy::IntVar(..) => Ty::Scalar(Scalar::Int(IntTy::I32)), + InferTy::FloatVar(..) => Ty::Scalar(Scalar::Float(FloatTy::F64)), + InferTy::MaybeNeverTypeVar(..) => Ty::Never, } } } -- cgit v1.2.3