mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
hir-ty: change struct constructor formatting.
before, when formatting struct constructor for `struct S(usize, usize)` it would format as: extern "rust-call" S(usize, usize) -> S but after this change, we'll format as: fn S(usize, usize) -> S
This commit is contained in:
parent
efaf8bd5de
commit
5cba3e72bc
6 changed files with 54 additions and 53 deletions
|
@ -1008,7 +1008,7 @@ impl HirDisplay for Ty {
|
|||
if let Safety::Unsafe = sig.safety {
|
||||
write!(f, "unsafe ")?;
|
||||
}
|
||||
if !matches!(sig.abi, FnAbi::Rust) {
|
||||
if !matches!(sig.abi, FnAbi::Rust | FnAbi::RustCall) {
|
||||
f.write_str("extern \"")?;
|
||||
f.write_str(sig.abi.as_str())?;
|
||||
f.write_str("\" ")?;
|
||||
|
@ -1025,6 +1025,7 @@ impl HirDisplay for Ty {
|
|||
)?
|
||||
}
|
||||
CallableDefId::StructId(s) => {
|
||||
write!(f, "fn ")?;
|
||||
f.start_location_link(def.into());
|
||||
write!(f, "{}", db.struct_data(s).name.display(f.db.upcast(), f.edition()))?
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue