From e51d44a2de36fd6e451a3aaf96c7526c589c2c42 Mon Sep 17 00:00:00 2001 From: Marcus Klaas de Vries Date: Mon, 7 Jan 2019 20:43:41 +0100 Subject: Process explicit type hints for str, bool and char --- crates/ra_hir/src/ty.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'crates/ra_hir/src/ty.rs') diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 7827e82c4..8adeedddb 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs @@ -308,7 +308,13 @@ impl Ty { path: &Path, ) -> Cancelable { if let Some(name) = path.as_ident() { - if let Some(int_ty) = primitive::IntTy::from_name(name) { + if let Some(KnownName::Bool) = name.as_known_name() { + return Ok(Ty::Bool); + } else if let Some(KnownName::Char) = name.as_known_name() { + return Ok(Ty::Char); + } else if let Some(KnownName::Str) = name.as_known_name() { + return Ok(Ty::Str); + } else if let Some(int_ty) = primitive::IntTy::from_name(name) { return Ok(Ty::Int(int_ty)); } else if let Some(uint_ty) = primitive::UintTy::from_name(name) { return Ok(Ty::Uint(uint_ty)); -- cgit v1.2.3