Skip to content

Commit 121f01b

Browse files
committed
Fix rustc --unpretty=expanded emit of [const] [unsafe] impl Trait for
1 parent 0966944 commit 121f01b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/rustc_ast_pretty/src/pprust/state/item.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ impl<'a> State<'a> {
344344
let ast::TraitImplHeader { defaultness, safety, polarity, ref trait_ref } =
345345
*of_trait;
346346
self.print_defaultness(defaultness);
347+
self.print_constness(*constness);
347348
self.print_safety(safety);
348349
impl_generics(self);
349-
self.print_constness(*constness);
350350
if let ast::ImplPolarity::Negative(_) = polarity {
351351
self.word("!");
352352
}

tests/ui/unpretty/exhaustive.expanded.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ mod items {
449449
impl () {}
450450
impl<T> () {}
451451
impl Default for () {}
452-
impl<T> const Default for () {}
452+
const impl<T> Default for () {}
453453
}
454454
/// ItemKind::MacCall
455455
mod item_mac_call { }

0 commit comments

Comments
 (0)