Fix spacing and ordering of words in pretty printed Impl
This commit is contained in:
parent
f3df63f8ee
commit
a24e238bdf
@ -1285,14 +1285,17 @@ impl<'a> State<'a> {
|
|||||||
self.print_visibility(&item.vis);
|
self.print_visibility(&item.vis);
|
||||||
self.print_defaultness(defaultness);
|
self.print_defaultness(defaultness);
|
||||||
self.print_unsafety(unsafety);
|
self.print_unsafety(unsafety);
|
||||||
self.word_nbsp("impl");
|
self.word("impl");
|
||||||
self.print_constness(constness);
|
|
||||||
|
|
||||||
if !generics.params.is_empty() {
|
if generics.params.is_empty() {
|
||||||
|
self.nbsp();
|
||||||
|
} else {
|
||||||
self.print_generic_params(&generics.params);
|
self.print_generic_params(&generics.params);
|
||||||
self.space();
|
self.space();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.print_constness(constness);
|
||||||
|
|
||||||
if let ast::ImplPolarity::Negative(_) = polarity {
|
if let ast::ImplPolarity::Negative(_) = polarity {
|
||||||
self.word("!");
|
self.word("!");
|
||||||
}
|
}
|
||||||
|
@ -603,7 +603,7 @@ fn test_item() {
|
|||||||
stringify_item!(
|
stringify_item!(
|
||||||
impl<T> Struct<T> {}
|
impl<T> Struct<T> {}
|
||||||
),
|
),
|
||||||
"impl <T> Struct<T> {}", // FIXME
|
"impl<T> Struct<T> {}",
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
stringify_item!(
|
stringify_item!(
|
||||||
@ -615,7 +615,7 @@ fn test_item() {
|
|||||||
stringify_item!(
|
stringify_item!(
|
||||||
impl<T> const Trait for T {}
|
impl<T> const Trait for T {}
|
||||||
),
|
),
|
||||||
"impl const <T> Trait for T {}", // FIXME
|
"impl<T> const Trait for T {}",
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
stringify_item!(
|
stringify_item!(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user