Skip to content
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

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

Open
joshtriplett opened this issue Jul 3, 2023 · 1 comment
Open
Labels
blocked Blocked on rustc, an RFC, etc.

Comments

@joshtriplett
Copy link
Member

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.

@ytmimi ytmimi added the blocked Blocked on rustc, an RFC, etc. label Aug 3, 2023
@ytmimi
Copy link
Contributor

ytmimi commented Dec 29, 2023

I believe this is related #5990.

We could version gate the fix before we get style edition rolled out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Blocked on rustc, an RFC, etc.
Projects
None yet
Development

No branches or pull requests

2 participants