-
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
Derive Copy for std::ops::Range and RangeFrom #27186
Conversation
`RangeTo` and `RangeFull` already have it.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pcwalton (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. 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. |
These don't have it because they're iterators. let mut iter = 0..n;
for i in iter { if i > 2 { break; } }
iter.collect() Here |
Ok, so there was a reason. “The choice […] was made” seems to contradict “no decision has been made yet.” If the decision against implementing |
Yeah we've decided in the past to not take this, so I'm going to close this for now. |
@SimonSapin original phrasing was a bit off. What I meant to say was that no decision has been made for switching to linting (which my personal preference). |
[breaking-change] due to the removal of Copy which shouldn't have been there in the first place, as per policy set forth in rust-lang#27186.
I favor a lint, since this code pattern is now not possible: let three_times = 0_u32..3_u32;
for _ in three_times {
...
}
for _ in three_times {
...
} |
RangeTo
andRangeFull
already have it.