aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorJade <[email protected]>2021-05-11 13:06:33 +0100
committerJade <[email protected]>2021-05-11 13:25:19 +0100
commitdc63fea427280ff278bf89a8b9c78df606009910 (patch)
tree5fb6eae3df58a7c5bc3bc5a1220dd9a5d6d3ea86 /crates/ide
parent77f0c92fd8311bccc001ddaf9eb72662d35e9836 (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/ide')
-rw-r--r--crates/ide/src/inlay_hints.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs
index e0bf660c4..960d169f4 100644
--- a/crates/ide/src/inlay_hints.rs
+++ b/crates/ide/src/inlay_hints.rs
@@ -1126,7 +1126,7 @@ fn main() {
1126 r#" 1126 r#"
1127fn main() { 1127fn main() {
1128 let data = &[1i32, 2, 3]; 1128 let data = &[1i32, 2, 3];
1129 //^^^^ &[i32; _] 1129 //^^^^ &[i32; 3]
1130 for i 1130 for i
1131}"#, 1131}"#,
1132 ); 1132 );