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.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index 0f49a0e54..dd7cd979f 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -9,6 +9,7 @@ use std::iter;
9use std::sync::Arc; 9use std::sync::Arc;
10 10
11use hir_def::{ 11use hir_def::{
12 builtin_type::BuiltinType,
12 path::{GenericArg, PathSegment}, 13 path::{GenericArg, PathSegment},
13 type_ref::{TypeBound, TypeRef}, 14 type_ref::{TypeBound, TypeRef},
14}; 15};
@@ -24,10 +25,13 @@ use crate::{
24 generics::{GenericDef, WherePredicate}, 25 generics::{GenericDef, WherePredicate},
25 nameres::Namespace, 26 nameres::Namespace,
26 resolve::{Resolver, TypeNs}, 27 resolve::{Resolver, TypeNs},
27 ty::Adt, 28 ty::{
29 primitive::{FloatTy, IntTy},
30 Adt,
31 },
28 util::make_mut_slice, 32 util::make_mut_slice,
29 BuiltinType, Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, 33 Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, Trait,
30 Trait, TypeAlias, Union, 34 TypeAlias, Union,
31}; 35};
32 36
33impl Ty { 37impl Ty {
@@ -643,8 +647,10 @@ fn type_for_builtin(def: BuiltinType) -> Ty {
643 BuiltinType::Char => TypeCtor::Char, 647 BuiltinType::Char => TypeCtor::Char,
644 BuiltinType::Bool => TypeCtor::Bool, 648 BuiltinType::Bool => TypeCtor::Bool,
645 BuiltinType::Str => TypeCtor::Str, 649 BuiltinType::Str => TypeCtor::Str,
646 BuiltinType::Int(ty) => TypeCtor::Int(ty.into()), 650 BuiltinType::Int { signedness, bitness } => {
647 BuiltinType::Float(ty) => TypeCtor::Float(ty.into()), 651 TypeCtor::Int(IntTy { signedness, bitness }.into())
652 }
653 BuiltinType::Float { bitness } => TypeCtor::Float(FloatTy { bitness }.into()),
648 }) 654 })
649} 655}
650 656