aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty/lower.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r--crates/ra_hir/src/ty/lower.rs34
1 files changed, 2 insertions, 32 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index 485871e69..2d23890a5 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -9,7 +9,7 @@ use std::iter;
9use std::sync::Arc; 9use std::sync::Arc;
10 10
11use hir_def::{ 11use hir_def::{
12 builtin_type::{BuiltinFloat, BuiltinInt, BuiltinType}, 12 builtin_type::BuiltinType,
13 generics::WherePredicate, 13 generics::WherePredicate,
14 path::{GenericArg, PathSegment}, 14 path::{GenericArg, PathSegment},
15 resolver::{HasResolver, Resolver, TypeNs}, 15 resolver::{HasResolver, Resolver, TypeNs},
@@ -27,7 +27,7 @@ use super::{
27use crate::{ 27use crate::{
28 db::HirDatabase, 28 db::HirDatabase,
29 ty::{ 29 ty::{
30 primitive::{FloatTy, IntTy, Uncertain}, 30 primitive::{FloatTy, IntTy},
31 Adt, 31 Adt,
32 }, 32 },
33 util::make_mut_slice, 33 util::make_mut_slice,
@@ -679,36 +679,6 @@ fn type_for_builtin(def: BuiltinType) -> Ty {
679 }) 679 })
680} 680}
681 681
682impl From<BuiltinInt> for IntTy {
683 fn from(t: BuiltinInt) -> Self {
684 IntTy { signedness: t.signedness, bitness: t.bitness }
685 }
686}
687
688impl From<BuiltinFloat> for FloatTy {
689 fn from(t: BuiltinFloat) -> Self {
690 FloatTy { bitness: t.bitness }
691 }
692}
693
694impl From<Option<BuiltinInt>> for Uncertain<IntTy> {
695 fn from(t: Option<BuiltinInt>) -> Self {
696 match t {
697 None => Uncertain::Unknown,
698 Some(t) => Uncertain::Known(t.into()),
699 }
700 }
701}
702
703impl From<Option<BuiltinFloat>> for Uncertain<FloatTy> {
704 fn from(t: Option<BuiltinFloat>) -> Self {
705 match t {
706 None => Uncertain::Unknown,
707 Some(t) => Uncertain::Known(t.into()),
708 }
709 }
710}
711
712fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: StructId) -> FnSig { 682fn fn_sig_for_struct_constructor(db: &impl HirDatabase, def: StructId) -> FnSig {
713 let struct_data = db.struct_data(def.into()); 683 let struct_data = db.struct_data(def.into());
714 let fields = struct_data.variant_data.fields(); 684 let fields = struct_data.variant_data.fields();