-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
associated_type_defaults not working correctly #35986
Comments
I'm also seeing this issue. To be precise, it seems that the default associated type is not used to type check the body of an impl. My example:
|
Adding |
So the original issue was a kind of feature request, related to trait objects and the requirements on them. I've added it to the tracking issue for associated type defaults (#29661) because I agree it's a useful data point. @nrc, the thing you mentioned seems like a separate issue -- arguably a bug, although this interacts with specialization. Basically the reason that the In short, defaults aren't really intended for use right now, and don't have agreed upon semantics. =) |
(To be clear, though, I think that the @nrc example should probably work, even in the current "in between" state.) |
This was resolved by rust-lang/rfcs#2532 specifying that defaults should be accounted for when using |
It seams like associated_type_defaults are not working. I have an example below from a query processing engine where I'm trying to use traits and associated types to express the application level Types of the (sql like) schema.
playpen link: https://play.rust-lang.org/?gist=2d2295013a3b9bb859b3e04bc1b9dc18&version=nightly&backtrace=0
leads to the result of:
Which is the same error you get when there is no DiskType default. I would like that case to work too, but it's somewhat out of scope of what I'm asking for here.
The text was updated successfully, but these errors were encountered: