mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Count query entries in memory usage command
This commit is contained in:
parent
b6fb35f20c
commit
ccce893577
5 changed files with 56 additions and 18 deletions
|
@ -553,7 +553,17 @@ fn render_const_scalar(
|
|||
render_const_scalar(f, bytes, memory_map, t)
|
||||
}
|
||||
_ => {
|
||||
let addr = usize::from_le_bytes(b.try_into().unwrap());
|
||||
let addr = usize::from_le_bytes(match b.try_into() {
|
||||
Ok(b) => b,
|
||||
Err(_) => {
|
||||
never!(
|
||||
"tried rendering ty {:?} in const ref with incorrect byte count {}",
|
||||
t,
|
||||
b.len()
|
||||
);
|
||||
return f.write_str("<layout-error>");
|
||||
}
|
||||
});
|
||||
let Ok(layout) = f.db.layout_of_ty(t.clone(), krate) else {
|
||||
return f.write_str("<layout-error>");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue