mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Show type alias layout on hover
This commit is contained in:
parent
a4966c9282
commit
ecc081d625
2 changed files with 7 additions and 4 deletions
|
@ -473,7 +473,10 @@ pub(super) fn definition(
|
|||
}),
|
||||
Definition::Trait(it) => label_and_docs(db, it),
|
||||
Definition::TraitAlias(it) => label_and_docs(db, it),
|
||||
Definition::TypeAlias(it) => label_and_docs(db, it),
|
||||
Definition::TypeAlias(it) => label_and_layout_info_and_docs(db, it, |&it| {
|
||||
let layout = it.ty(db).layout(db).ok()?;
|
||||
Some(format!("size = {}, align = {}", layout.size.bytes(), layout.align.abi.bytes()))
|
||||
}),
|
||||
Definition::BuiltinType(it) => {
|
||||
return famous_defs
|
||||
.and_then(|fd| builtin(fd, it))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue