-
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
Add Extend impls for tuples of arity 1 through 12 #132187
base: master
Are you sure you want to change the base?
Conversation
This was discussed in #85835 (comment) and I want to get that effort started. It's been forever since I contributed to rustc, so please excuse if I did something wrong. If this is deemed OK, I would be happy to follow this up with the same treatmeant for |
r? libs-api |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
@rust-lang/libs-api:
fn main() {
let iter = std::iter::repeat_n(('a', 'b', 'c'), 3);
- let mut collection = (Vec::new(), (Vec::new(), Vec::new()));
- iter.map(|(a, b, c)| (a, (b, c))).collect_into(&mut collection);
- let (va, (vb, vc)) = collection;
+ let mut collections = (Vec::new(), Vec::new(), Vec::new());
+ iter.collect_into(&mut collections);
+ let (va, vb, vc) = collections;
println!("{:?}\n{:?}\n{:?}", va, vb, vc);
} |
Team member @dtolnay 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. |
How so? This doesn't change |
You are right. I've updated the motivating use case to use |
This comment was marked as duplicate.
This comment was marked as duplicate.
I noticed I made a silly mistake, I added tuple impls for not just 12-tuples but 13-tuples accidentally. I am also adding some tests for these impls, but I wonder, is there a good example to verify 13-tuples do not have the Extend impl? I also want to add the FromIterator<(EA, ...)> for (A, ...) impls. Should these go into a new PR? That would enable this:
|
No description provided.