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

feature(non_lifetime_binder) syntax gets removed #5721

Closed
BoxyUwU opened this issue Mar 22, 2023 · 2 comments · Fixed by #5848
Closed

feature(non_lifetime_binder) syntax gets removed #5721

BoxyUwU opened this issue Mar 22, 2023 · 2 comments · Fixed by #5848
Labels
blocked Blocked on rustc, an RFC, etc. bug Panic, non-idempotency, invalid code, etc.

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented Mar 22, 2023

the following code:

#![feature(non_lifetime_binders)]
#![allow(incomplete_features)]

trait Other<U: ?Sized> {}

trait Trait<U> 
where
    for<T> U: Other<T> {}

when formatted is:

#![feature(non_lifetime_binders)]
#![allow(incomplete_features)]

trait Other<U: ?Sized> {}

trait Trait<U>
where
    U: Other<T>,
{
}
@ytmimi
Copy link
Contributor

ytmimi commented Mar 22, 2023

Here's the tracking issue for #![feature(non_lifetime_binders)] rust-lang/rust#108185,

@calebcartwright I'm not sure if t-style needs to be looped in for the experimental syntax or if we can handle a fix for this on our own. Given that our rust-toolchain is currently at nightly-2023-01-24 and this feature landed a month ago, we'd probably need a subtree sync before we could resolve this.

@ytmimi ytmimi added bug Panic, non-idempotency, invalid code, etc. blocked Blocked on rustc, an RFC, etc. labels Mar 22, 2023
@calebcartwright
Copy link
Member

We actually coincidentally discussed this at the t-style meeting earlier today, but fortunately this is just a case where rustfmt was operating under the assumption that it would never see a type binder in this particular position vs. there not being formatting rules for how to handle the syntax.

I.e., I don't think there's anything net new at the AST level that we need to derive something for, we probably just have a logic assumption somewhere that needs to be tweaked.

Given that our rust-toolchain is currently at nightly-2023-01-24 and this feature landed a month ago, we'd probably need a subtree sync before we could resolve this.

If this is particularly problematic for rustc then, assuming a fix is as trivial as I suspect, then I wouldn't mind in this instance letting the fix be applied directly in-tree in r-l/rust, but otherwise yes, to fix here we'd need to do a sync and I think I'm still a few PR reviews out from that (so probably at least 2 weeks)

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. bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants