let ty = ty.make(offset + text.len(), id, scx)?;
text.push_str(&ty.text);
- text.push_str(" = ");
- let expr = pprust::expr_to_string(expr).replace('\n', " ");
- text.push_str(&expr);
+ if let Some(expr) = expr {
+ text.push_str(" = ");
+ let expr = pprust::expr_to_string(expr).replace('\n', " ");
+ text.push_str(&expr);
+ }
+
text.push(';');
Ok(extend_sig(ty, text, defs, vec![]))
let ty = ty.make(offset + text.len(), id, scx)?;
text.push_str(&ty.text);
- text.push_str(" = ");
- let expr = pprust::expr_to_string(expr).replace('\n', " ");
- text.push_str(&expr);
+ if let Some(expr) = expr {
+ text.push_str(" = ");
+ let expr = pprust::expr_to_string(expr).replace('\n', " ");
+ text.push_str(&expr);
+ }
+
text.push(';');
Ok(extend_sig(ty, text, defs, vec![]))
Ok(sig)
}
- ast::ForeignItemKind::Static(ref ty, m) => {
+ ast::ForeignItemKind::Static(ref ty, m, _) => {
let mut text = "static ".to_owned();
if m == ast::Mutability::Mut {
text.push_str("mut ");
Ok(extend_sig(ty_sig, text, defs, vec![]))
}
- ast::ForeignItemKind::Ty => {
+ ast::ForeignItemKind::TyAlias(..) => {
let mut text = "type ".to_owned();
let name = self.ident.to_string();
let defs = vec![SigElement {