Skip to content

Fix position of auto in auto trait declaration #2720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions tests/source/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ trait FooBar = Foo

// #2637
auto trait Example {}
pub auto trait PubExample {}
pub unsafe auto trait PubUnsafeExample {}
2 changes: 2 additions & 0 deletions tests/target/trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ trait FooBar = Foo

// #2637
auto trait Example {}
pub auto trait PubExample {}
pub unsafe auto trait PubUnsafeExample {}