From 5d56adb10cd2510594d47fec587c6f54c585f266 Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Fri, 18 May 2018 17:25:33 -0400 Subject: [PATCH] Fix position of auto in auto trait declaration --- src/items.rs | 2 +- tests/source/trait.rs | 2 ++ tests/target/trait.rs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) 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 {}