Skip to content

Commit 5d56adb

Browse files
committed
Fix position of auto in auto trait declaration
1 parent b0eb899 commit 5d56adb

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,9 +963,9 @@ pub fn format_trait(context: &RewriteContext, item: &ast::Item, offset: Indent)
963963
let mut result = String::with_capacity(128);
964964
let header = format!(
965965
"{}{}{}trait ",
966-
format_auto(is_auto),
967966
format_visibility(&item.vis),
968967
format_unsafety(unsafety),
968+
format_auto(is_auto),
969969
);
970970
result.push_str(&header);
971971

tests/source/trait.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,5 @@ trait FooBar = Foo
9595

9696
// #2637
9797
auto trait Example {}
98+
pub auto trait PubExample {}
99+
pub unsafe auto trait PubUnsafeExample {}

tests/target/trait.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,5 @@ trait FooBar = Foo
133133

134134
// #2637
135135
auto trait Example {}
136+
pub auto trait PubExample {}
137+
pub unsafe auto trait PubUnsafeExample {}

0 commit comments

Comments
 (0)