Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/display.rs')
| -rw-r--r-- | crates/hir/src/display.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/crates/hir/src/display.rs b/crates/hir/src/display.rs index 72e79af75d..7def828e95 100644 --- a/crates/hir/src/display.rs +++ b/crates/hir/src/display.rs @@ -82,8 +82,7 @@ impl HirDisplay for Function { f.write_str("unsafe ")?; } if let Some(abi) = &data.abi { - // FIXME: String escape? - write!(f, "extern \"{}\" ", &**abi)?; + write!(f, "extern \"{}\" ", abi.as_str())?; } write!(f, "fn {}", data.name.display(f.db.upcast()))?; @@ -115,7 +114,10 @@ impl HirDisplay for Function { } if data.is_varargs() { - f.write_str(", ...")?; + if !first { + f.write_str(", ")?; + } + f.write_str("...")?; } f.write_char(')')?; @@ -135,9 +137,9 @@ impl HirDisplay for Function { .as_ref() .unwrap() } - _ => panic!("Async fn ret_type should be impl Future"), + _ => &TypeRef::Error, }, - _ => panic!("Async fn ret_type should be impl Future"), + _ => &TypeRef::Error, } }; |