mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
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?
This commit is contained in:
parent
77f0c92fd8
commit
dc63fea427
12 changed files with 155 additions and 110 deletions
|
@ -308,7 +308,7 @@ impl HirDisplay for Const {
|
|||
let param_data = &generics.params.consts[id.local_id];
|
||||
write!(f, "{}", param_data.name)
|
||||
}
|
||||
ConstValue::Concrete(_) => write!(f, "_"),
|
||||
ConstValue::Concrete(c) => write!(f, "{}", c.interned),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue