From e6545cc647829091dd5aae5753bd4f5302becab6 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 May 2019 14:05:35 +0300 Subject: add ModuleDef::BuiltInType --- crates/ra_hir/src/ty/primitive.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'crates/ra_hir/src/ty/primitive.rs') diff --git a/crates/ra_hir/src/ty/primitive.rs b/crates/ra_hir/src/ty/primitive.rs index b37326db7..e1ab16a6f 100644 --- a/crates/ra_hir/src/ty/primitive.rs +++ b/crates/ra_hir/src/ty/primitive.rs @@ -30,6 +30,12 @@ pub enum UncertainIntTy { Known(IntTy), } +impl From for UncertainIntTy { + fn from(ty: IntTy) -> Self { + UncertainIntTy::Known(ty) + } +} + impl fmt::Display for UncertainIntTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { @@ -45,6 +51,12 @@ pub enum UncertainFloatTy { Known(FloatTy), } +impl From for UncertainFloatTy { + fn from(ty: FloatTy) -> Self { + UncertainFloatTy::Known(ty) + } +} + impl fmt::Display for UncertainFloatTy { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { -- cgit v1.2.3