diff options
author | Marcus Klaas de Vries <[email protected]> | 2019-01-07 19:43:41 +0000 |
---|---|---|
committer | Marcus Klaas de Vries <[email protected]> | 2019-01-07 19:43:41 +0000 |
commit | e51d44a2de36fd6e451a3aaf96c7526c589c2c42 (patch) | |
tree | 969f3cb2b0eb5cb62f384fd85a5422d894d4e978 /crates/ra_hir/src/ty.rs | |
parent | 5d15dd70b037b3d1623ebd83d8ef0f66ad6950af (diff) |
Process explicit type hints for str, bool and char
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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 { | |||
308 | path: &Path, | 308 | path: &Path, |
309 | ) -> Cancelable<Self> { | 309 | ) -> Cancelable<Self> { |
310 | if let Some(name) = path.as_ident() { | 310 | if let Some(name) = path.as_ident() { |
311 | if let Some(int_ty) = primitive::IntTy::from_name(name) { | 311 | if let Some(KnownName::Bool) = name.as_known_name() { |
312 | return Ok(Ty::Bool); | ||
313 | } else if let Some(KnownName::Char) = name.as_known_name() { | ||
314 | return Ok(Ty::Char); | ||
315 | } else if let Some(KnownName::Str) = name.as_known_name() { | ||
316 | return Ok(Ty::Str); | ||
317 | } else if let Some(int_ty) = primitive::IntTy::from_name(name) { | ||
312 | return Ok(Ty::Int(int_ty)); | 318 | return Ok(Ty::Int(int_ty)); |
313 | } else if let Some(uint_ty) = primitive::UintTy::from_name(name) { | 319 | } else if let Some(uint_ty) = primitive::UintTy::from_name(name) { |
314 | return Ok(Ty::Uint(uint_ty)); | 320 | return Ok(Ty::Uint(uint_ty)); |