diff --git a/compiler/rustc_ast_pretty/src/pprust/state/item.rs b/compiler/rustc_ast_pretty/src/pprust/state/item.rs index 1dbd5719ae066..8602a21a43487 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state/item.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state/item.rs @@ -344,9 +344,9 @@ impl<'a> State<'a> { let ast::TraitImplHeader { defaultness, safety, polarity, ref trait_ref } = *of_trait; self.print_defaultness(defaultness); + self.print_constness(*constness); self.print_safety(safety); impl_generics(self); - self.print_constness(*constness); if let ast::ImplPolarity::Negative(_) = polarity { self.word("!"); } diff --git a/tests/ui/unpretty/exhaustive.expanded.stdout b/tests/ui/unpretty/exhaustive.expanded.stdout index f555904e5dd7d..17995cabc75a7 100644 --- a/tests/ui/unpretty/exhaustive.expanded.stdout +++ b/tests/ui/unpretty/exhaustive.expanded.stdout @@ -449,7 +449,7 @@ mod items { impl () {} impl () {} impl Default for () {} - impl const Default for () {} + const impl Default for () {} } /// ItemKind::MacCall mod item_mac_call { }