-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Empty bounds lists in where clauses cause the type to not be WF-checked. #53696
Comments
rustc_typeck: turn `where Type:,` into a WF(Type) predicate, instead of ignoring it. Fixes #53696, assuming crater doesn't catch anyone using this syntax already. r? @nikomatsakis cc @petrochenkov
Why is |
@Centril We're pretty permissive with parsing "zero or more" of many syntax elements, e.g. |
@cramertj Oh I see; that's where this is coming from. It didn't click initially; Thanks! ❤️ |
We discussed this briefly on the meeting and the consensus was that if crater passes, then this is fine. |
This is waiting on @nikomatsakis or someone else r+'ing #53707 (crater was clean). |
rustc_typeck: turn `where Type:,` into a WF(Type) predicate, instead of ignoring it. Fixes #53696, assuming crater doesn't catch anyone using this syntax already. Allowing an empty list of bounds in the grammar was done for the benefit of macro authors, most of which would *probably* be using it for bounds on type parameters, which are always WF. r? @nikomatsakis cc @petrochenkov
This produces no error:
Just like the other known "missing WF checks" bug (#21903):
Unlike type aliases, I don't believe you can even reach the type written in the
where
clause without any bounds, since it doesn't even "remain in the type/trait-system" (e.g. inference can't pick it up).So it's not as bad, but I did come up with use for it as a WF requirement, in #44580 (comment).
cc @rust-lang/lang @RalfJung @petrochenkov
The text was updated successfully, but these errors were encountered: