Support non-lifetime binders#5848
Conversation
| ) -> Option<String> { | ||
| let result = generic_params | ||
| .iter() | ||
| .filter(|p| matches!(p.kind, ast::GenericParamKind::Lifetime)) |
There was a problem hiding this comment.
Removing this filter line is the only non-name-tweaking change.
6614042 to
a2622a2
Compare
| #![feature(non_lifetime_binders)] | ||
| #![allow(incomplete_features)] | ||
|
|
||
| trait Other<U: ?Sized> {} | ||
|
|
||
| trait Trait<U> | ||
| where | ||
| for<T> U: Other<T> {} |
There was a problem hiding this comment.
No real issue keeping the source file, but I just want to point out that the target file is enough to show that the input is idempotent, and that rustfmt no longer remove the for<T>.
a2622a2 to
a99f36e
Compare
|
Thanks! |
|
rustfmt doesn't seem to break lengthy higher-ranked parameter lists (ones that contain long binder names or lots of bounds) into multiple lines yet though at least according to my limited testing. Slightly unrelated since this seems to concern (the stable) lifetime binders, too. Just something I've noticed. Might require a style edition though. Edit: For verbose lifetime names only I guess, everything else is unstable or semantically not permitted yet in rustc. |
@fmease it would be great if you could open up a new issue and provide some example code snippets that the team can use to investigate. |
Makes it so we stop yeeting non-lifetime binders into the void. Rustfmt already generally supports formatting
ast::GenericParamanyways, so this just is piggybacking on that formatting.Fixes #5721