diff --git a/src/items.rs b/src/items.rs index 820470ed35c..7da3f8c14d4 100644 --- a/src/items.rs +++ b/src/items.rs @@ -963,9 +963,9 @@ pub fn format_trait(context: &RewriteContext, item: &ast::Item, offset: Indent) let mut result = String::with_capacity(128); let header = format!( "{}{}{}trait ", - format_auto(is_auto), format_visibility(&item.vis), format_unsafety(unsafety), + format_auto(is_auto), ); result.push_str(&header); diff --git a/tests/source/trait.rs b/tests/source/trait.rs index 9f0c73694bf..1d1faf2d475 100644 --- a/tests/source/trait.rs +++ b/tests/source/trait.rs @@ -95,3 +95,5 @@ trait FooBar = Foo // #2637 auto trait Example {} +pub auto trait PubExample {} +pub unsafe auto trait PubUnsafeExample {} diff --git a/tests/target/trait.rs b/tests/target/trait.rs index a6bc2d89689..b60244f8e4f 100644 --- a/tests/target/trait.rs +++ b/tests/target/trait.rs @@ -133,3 +133,5 @@ trait FooBar = Foo // #2637 auto trait Example {} +pub auto trait PubExample {} +pub unsafe auto trait PubUnsafeExample {}