Skip to content

Commit

Permalink
Fix unsafe auto trait pretty print.
Browse files Browse the repository at this point in the history
It was being printed wrong as auto unsafe trait
  • Loading branch information
leoyvens committed Nov 3, 2017
1 parent ca26f01 commit 5190abb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1341,8 +1341,8 @@ impl<'a> State<'a> {
ast::ItemKind::Trait(is_auto, unsafety, ref generics, ref bounds, ref trait_items) => {
self.head("")?;
self.print_visibility(&item.vis)?;
self.print_is_auto(is_auto)?;
self.print_unsafety(unsafety)?;
self.print_is_auto(is_auto)?;
self.word_nbsp("trait")?;
self.print_ident(item.ident)?;
self.print_generics(generics)?;
Expand Down
2 changes: 2 additions & 0 deletions src/test/pretty/auto-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@

auto trait MyTrait { }

unsafe auto trait UnsafeMyTrait { }

pub fn main() { }

0 comments on commit 5190abb

Please sign in to comment.