diff options
author | Seivan Heidari <[email protected]> | 2019-10-31 08:43:20 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-10-31 08:43:20 +0000 |
commit | 8edda0e7b164009d6c03bb3d4be603fb38ad2e2a (patch) | |
tree | 744cf81075d394e2f9c06afb07642a2601800dda /crates/ra_hir/src/ty/lower.rs | |
parent | 49562d36b97ddde34cf7585a8c2e8f232519b657 (diff) | |
parent | d067afb064a7fa67b172abf561b7d80740cd6f18 (diff) |
Merge branch 'master' into feature/themes
Diffstat (limited to 'crates/ra_hir/src/ty/lower.rs')
-rw-r--r-- | crates/ra_hir/src/ty/lower.rs | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs index 366556134..dd7cd979f 100644 --- a/crates/ra_hir/src/ty/lower.rs +++ b/crates/ra_hir/src/ty/lower.rs | |||
@@ -8,6 +8,12 @@ | |||
8 | use std::iter; | 8 | use std::iter; |
9 | use std::sync::Arc; | 9 | use std::sync::Arc; |
10 | 10 | ||
11 | use hir_def::{ | ||
12 | builtin_type::BuiltinType, | ||
13 | path::{GenericArg, PathSegment}, | ||
14 | type_ref::{TypeBound, TypeRef}, | ||
15 | }; | ||
16 | |||
11 | use super::{ | 17 | use super::{ |
12 | FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, | 18 | FnSig, GenericPredicate, ProjectionPredicate, ProjectionTy, Substs, TraitRef, Ty, TypeCtor, |
13 | TypeWalk, | 19 | TypeWalk, |
@@ -18,13 +24,14 @@ use crate::{ | |||
18 | generics::HasGenericParams, | 24 | generics::HasGenericParams, |
19 | generics::{GenericDef, WherePredicate}, | 25 | generics::{GenericDef, WherePredicate}, |
20 | nameres::Namespace, | 26 | nameres::Namespace, |
21 | path::{GenericArg, PathSegment}, | ||
22 | resolve::{Resolver, TypeNs}, | 27 | resolve::{Resolver, TypeNs}, |
23 | ty::Adt, | 28 | ty::{ |
24 | type_ref::{TypeBound, TypeRef}, | 29 | primitive::{FloatTy, IntTy}, |
30 | Adt, | ||
31 | }, | ||
25 | util::make_mut_slice, | 32 | util::make_mut_slice, |
26 | BuiltinType, Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, | 33 | Const, Enum, EnumVariant, Function, ModuleDef, Path, Static, Struct, StructField, Trait, |
27 | Trait, TypeAlias, Union, | 34 | TypeAlias, Union, |
28 | }; | 35 | }; |
29 | 36 | ||
30 | impl Ty { | 37 | impl Ty { |
@@ -640,8 +647,10 @@ fn type_for_builtin(def: BuiltinType) -> Ty { | |||
640 | BuiltinType::Char => TypeCtor::Char, | 647 | BuiltinType::Char => TypeCtor::Char, |
641 | BuiltinType::Bool => TypeCtor::Bool, | 648 | BuiltinType::Bool => TypeCtor::Bool, |
642 | BuiltinType::Str => TypeCtor::Str, | 649 | BuiltinType::Str => TypeCtor::Str, |
643 | BuiltinType::Int(ty) => TypeCtor::Int(ty.into()), | 650 | BuiltinType::Int { signedness, bitness } => { |
644 | BuiltinType::Float(ty) => TypeCtor::Float(ty.into()), | 651 | TypeCtor::Int(IntTy { signedness, bitness }.into()) |
652 | } | ||
653 | BuiltinType::Float { bitness } => TypeCtor::Float(FloatTy { bitness }.into()), | ||
645 | }) | 654 | }) |
646 | } | 655 | } |
647 | 656 | ||