diff options
author | Jade <[email protected]> | 2021-05-11 13:06:33 +0100 |
---|---|---|
committer | Jade <[email protected]> | 2021-05-11 13:25:19 +0100 |
commit | dc63fea427280ff278bf89a8b9c78df606009910 (patch) | |
tree | 5fb6eae3df58a7c5bc3bc5a1220dd9a5d6d3ea86 /crates/hir_ty/src/display.rs | |
parent | 77f0c92fd8311bccc001ddaf9eb72662d35e9836 (diff) |
Add basic support for array lengths in types
This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead
of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range
array declarations are unsupported as before.
I don't know why a bunch of our rustc tests had single quotes inside
strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's
bad? Maybe something in a nightly?
Diffstat (limited to 'crates/hir_ty/src/display.rs')
-rw-r--r-- | crates/hir_ty/src/display.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 1f6edf7a2..8a4296697 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs | |||
@@ -308,7 +308,7 @@ impl HirDisplay for Const { | |||
308 | let param_data = &generics.params.consts[id.local_id]; | 308 | let param_data = &generics.params.consts[id.local_id]; |
309 | write!(f, "{}", param_data.name) | 309 | write!(f, "{}", param_data.name) |
310 | } | 310 | } |
311 | ConstValue::Concrete(_) => write!(f, "_"), | 311 | ConstValue::Concrete(c) => write!(f, "{}", c.interned), |
312 | } | 312 | } |
313 | } | 313 | } |
314 | } | 314 | } |