-
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
remove LengthAtMost32 on AsRef/Borrow impl for array #74026
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @withoutboats (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
When these bounds are removed, the resulting impl surface will not be expressible in current stable Rust. So we have to keep these bounds until const generics is stablized... |
We don't. By removing these bounds, we would be committing that std will always be able to implement traits for all array types. Since that's always been a completely consensus goal for everyone involved in Rust, and we have no reason to believe we won't eventually stabilize const generics at least powerful enough to implement traits for array types, I think we should remove this bound and provide this functionality to people sooner, rather than later. The decision to introduce this bound was always unnecessary conservatism. @rfcbot fcp merge |
Team member @withoutboats has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
@burrbull if we're going to do this, we should remove |
I agree: we're just committing that the standard library will implement such traits, which does not inherently commit us to any particular design for stable const generics outside the standard library; that just means we must provide a language facility the standard library can use for this purpose. |
Does this mean that now we could implement Copy, Hash, etc for all arrays? |
One thing which concerns me is So I fear that we will end up with |
Closed in favour of 74060. |
Remove trait LengthAtMost32 This is a continuation of rust-lang#74026 preserving the original burrbull's commit. I talked to @burrbull, he suggested me to finish his PR.
Since I did not receive a response to #71373 I tried to do PR.
All tests are passed on my PC. Is there any reason not to do this?
Thanks.