codelldb
codelldb copied to clipboard
Rust: &&Vec<_> is showing as empty vec
Configuration
OS: ArchLinux latest VSCode version: 1.58.0 (latest) Extension version: 1.6.5 (latest) Compiler: Rust 1.53 (latest stable) Build target: Linux AMD64
Issue
With the following code:
fn main() {
let v = vec![1, 2, 3];
let v_ref = &v;
let v_ref2 = &&v;
let v_ref3 = &&&v;
std::mem::drop(v_ref3);
}
&&Vec<_> (and further) is showing as empty vec[]:

This is a pretty common pattern when manipulating multi-dimensional arrays: patterns such as:
vec![vec![1,2,3]].iter().filter(|v| {/* ... */})
will have v be a &&Vec<_>.
This can be pretty misleading ^^
I get incorrect output for &&str as well.
&Vec works because we set eTypeOptionSkipReferences for Vec formatter, however this does not work with more indirection levels.