-
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
Type parameter defaults are not checked correctly #26633
Comments
Can you clarify what you are expecting here? this looks fine to me. You are allowed to declare that default and it will be manifested at a call site to |
@jroesch the default depends on |
@eddyb yeah that was my point, currently we don't check implied constraints like that in most places. You can do similar things in trait declarations but will receive a type error at a call site. Thought I agree that we should try to improve the error reporting. I would like to do some work in this area after we finish the current set of internal refactors. |
Triage: so is this a problem or not? |
cc @rust-lang/lang I am a bit worried about this. EDIT: Currently the example hits #36887 in playpen on stable (1.14). |
@rust-lang/lang didn't comment on this; I'm going to nominate. |
I believe we intentionally deprecated this with #36887 -- we can probably just close this issue, in my opinion. |
This typechecks:
Which doesn't really make a lot of sense and seems like it could be a backwards compatibility footgun.
The text was updated successfully, but these errors were encountered: