-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Constraints on associated types declared in subtraits do not propagate. #32722
Comments
Another example:
I don't think the problem is that the bounds "don't propagate". It simply should not matter to Edit: Here is my actual usecase. I think something like this is required to get ergonomic session types in Rust:
|
I ran into this when creating a trait that requires |
cc. @sebcrozet |
Is this the same issue as #20671? |
Current output suggests code that would be accepted today:
|
@estebank Rust error messages have come a long way :) In this particular case however it would be nice if Rust knew how to propagate the where clause on traits. Another similar demonstration looks like this:
Results in the compiler complaining that just because T must implement So even though the Rust compiler now makes a suggestion this is still painful as you must repeat the bounds everywhere (perhaps the entire point to make this trait was to imply a whole bunch of traits in a single name). |
That feature work is likely to happen at some point and it is widely requested. I haven't closed this ticket because the feature work is not done, but at least we have a mitigation in place. |
Pretty bad title - sorry. Somebody who knows the type checker might be able to do better.
Here is a minimal example:
http://is.gd/vjIVwO
The text was updated successfully, but these errors were encountered: