aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/ty
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-05-30 13:03:58 +0100
committerAleksey Kladov <[email protected]>2019-05-30 13:03:58 +0100
commit97158f5c8a6dadf3bcf28601f739ab6b7c4464aa (patch)
tree3b1fa7e454c538f767ba8dc512fe1305780902a6 /crates/ra_hir/src/ty
parent4e5b02966b068a9aecc9d47290e865b0d44ce9ce (diff)
add built-in types to scopes
Diffstat (limited to 'crates/ra_hir/src/ty')
-rw-r--r--crates/ra_hir/src/ty/lower.rs16
1 files changed, 0 insertions, 16 deletions
diff --git a/crates/ra_hir/src/ty/lower.rs b/crates/ra_hir/src/ty/lower.rs
index c4cef2d7c..d2ba01826 100644
--- a/crates/ra_hir/src/ty/lower.rs
+++ b/crates/ra_hir/src/ty/lower.rs
@@ -65,22 +65,6 @@ impl Ty {
65 } 65 }
66 66
67 pub(crate) fn from_hir_path(db: &impl HirDatabase, resolver: &Resolver, path: &Path) -> Self { 67 pub(crate) fn from_hir_path(db: &impl HirDatabase, resolver: &Resolver, path: &Path) -> Self {
68 if let Some(name) = path.as_ident() {
69 // TODO: remove this
70 if let Some(int_ty) = primitive::IntTy::from_type_name(name) {
71 return Ty::simple(TypeCtor::Int(primitive::UncertainIntTy::Known(int_ty)));
72 } else if let Some(float_ty) = primitive::FloatTy::from_type_name(name) {
73 return Ty::simple(TypeCtor::Float(primitive::UncertainFloatTy::Known(float_ty)));
74 } else if let Some(known) = name.as_known_name() {
75 match known {
76 KnownName::Bool => return Ty::simple(TypeCtor::Bool),
77 KnownName::Char => return Ty::simple(TypeCtor::Char),
78 KnownName::Str => return Ty::simple(TypeCtor::Str),
79 _ => {}
80 }
81 }
82 }
83
84 // Resolve the path (in type namespace) 68 // Resolve the path (in type namespace)
85 let resolution = resolver.resolve_path(db, path).take_types(); 69 let resolution = resolver.resolve_path(db, path).take_types();
86 70