fixup! Preserve and format type aliases in extern blocks

This commit is contained in:
Ayaz Hafiz 2020-05-09 16:01:42 -07:00 committed by Caleb Cartwright
parent a15800a327
commit a9b0b057eb
2 changed files with 7 additions and 2 deletions

View File

@ -1862,6 +1862,9 @@ pub(crate) fn rewrite_type_alias(
let lhs = format!("{}=", prefix);
rewrite_assign_rhs(context, lhs, &**ty, shape).map(|s| s + ";")
} else {
if !generics.where_clause.predicates.is_empty() {
prefix.push_str(&indent.to_string_with_newline(context.config));
}
Some(format!("{};", prefix))
}
}

View File

@ -3,11 +3,13 @@ extern "C" {
type A<'a>
where
'a: 'static,;
'a: 'static,
;
type A<T: Ord>
where
T: 'static,;
T: 'static,
;
type A = u8;