diff options
author | Lenard Pratt <[email protected]> | 2019-04-03 23:23:58 +0100 |
---|---|---|
committer | Lenard Pratt <[email protected]> | 2019-04-07 13:23:12 +0100 |
commit | 2d73c909fe03c799b488aa0f97a588e13bbd7006 (patch) | |
tree | b96bf7ccc6cc6e0ebb86e52ffad104f44f53d556 /crates/ra_hir/src/ty.rs | |
parent | 36f5d997565b6390a4b524e7e1d0d805f0f26bdb (diff) |
Added inference of array length
Diffstat (limited to 'crates/ra_hir/src/ty.rs')
-rw-r--r-- | crates/ra_hir/src/ty.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index d42c61e9d..77690309a 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -353,10 +353,14 @@ impl HirDisplay for ApplicationTy { | |||
353 | TypeCtor::Int(t) => write!(f, "{}", t)?, | 353 | TypeCtor::Int(t) => write!(f, "{}", t)?, |
354 | TypeCtor::Float(t) => write!(f, "{}", t)?, | 354 | TypeCtor::Float(t) => write!(f, "{}", t)?, |
355 | TypeCtor::Str => write!(f, "str")?, | 355 | TypeCtor::Str => write!(f, "str")?, |
356 | TypeCtor::Slice | TypeCtor::Array => { | 356 | TypeCtor::Slice => { |
357 | let t = self.parameters.as_single(); | 357 | let t = self.parameters.as_single(); |
358 | write!(f, "[{}]", t.display(f.db))?; | 358 | write!(f, "[{}]", t.display(f.db))?; |
359 | } | 359 | } |
360 | TypeCtor::Array => { | ||
361 | let t = self.parameters.as_single(); | ||
362 | write!(f, "[{};usize]", t.display(f.db))?; | ||
363 | } | ||
360 | TypeCtor::RawPtr(m) => { | 364 | TypeCtor::RawPtr(m) => { |
361 | let t = self.parameters.as_single(); | 365 | let t = self.parameters.as_single(); |
362 | write!(f, "*{}{}", m.as_keyword_for_ptr(), t.display(f.db))?; | 366 | write!(f, "*{}{}", m.as_keyword_for_ptr(), t.display(f.db))?; |