Skip to content

rustfmt puts where on same line as impl for empty impl even if long #5811

Open
@joshtriplett

Description

@joshtriplett

Given the following code:

impl<T: ?Sized, Idx> IndexRanges<Idx> for T
where
    T: Index<Range<Idx>, Output = Self::Output>
        + Index<RangeTo<Idx>, Output = Self::Output>
        + Index<RangeFrom<Idx>, Output = Self::Output>
        + Index<RangeInclusive<Idx>, Output = Self::Output>
        + Index<RangeToInclusive<Idx>, Output = Self::Output>
        + Index<RangeFull>,
{
}

rustfmt moves the where onto the same line as the impl. However, if you put a fn func() {} inside, it won't.

This may need to wait for a style edition to fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on rustc, an RFC, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions