Skip to content

Commit

Permalink
Prevent rustfmt from adding impl Trait definitions to types
Browse files Browse the repository at this point in the history
Fixes 5086
  • Loading branch information
ytmimi committed Nov 18, 2021
1 parent eee8f04 commit 9a18444
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1522,8 +1522,7 @@ pub(crate) fn rewrite_type_alias<'a, 'b>(
// https://github.com/rust-dev-tools/fmt-rfcs/blob/master/guide/items.md#type-aliases
match (visitor_kind, ty_opt) {
(Item(_), None) => {
let op_ty = OpaqueType { bounds };
rewrite_ty(rw_info, Some(bounds), Some(&op_ty), vis)
rewrite_ty::<OpaqueType<'_>>(rw_info, Some(bounds), None, vis)
}
(Item(_), Some(ty)) => rewrite_ty(rw_info, Some(bounds), Some(&*ty), vis),
(AssocImplItem(_), _) => {
Expand Down
1 change: 1 addition & 0 deletions tests/target/issue-5086/minimum_example.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
type Type: Bound;

0 comments on commit 9a18444

Please sign in to comment.