mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Cleanup error variants in MIR code slightly
This commit is contained in:
parent
8a5829cf28
commit
5860763f18
17 changed files with 598 additions and 434 deletions
|
@ -605,8 +605,11 @@ fn render_const_scalar(
|
|||
write!(f, "{}", f.db.union_data(u).name.display(f.db.upcast()))
|
||||
}
|
||||
hir_def::AdtId::EnumId(e) => {
|
||||
let Ok(target_data_layout) = f.db.target_data_layout(trait_env.krate) else {
|
||||
return f.write_str("<target-layout-not-available>");
|
||||
};
|
||||
let Some((var_id, var_layout)) =
|
||||
detect_variant_from_bytes(&layout, f.db, trait_env, b, e)
|
||||
detect_variant_from_bytes(&layout, f.db, &target_data_layout, b, e)
|
||||
else {
|
||||
return f.write_str("<failed-to-detect-variant>");
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue