1

Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clo...

 11 months ago
source link: https://github.com/rust-lang/rust/pull/111278
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Contributor

@EFanZh EFanZh

commented

May 6, 2023

edited by Dylan-DPC

Currently, if T implements Clone, we can create a Vec<T> from an &[T] or an &mut [T], can we also support creating a Vec<T> from an &[T; N] or an &mut [T; N]? Also, do I need to add #[inline] to the implementation?

ACP: rust-lang/libs-team#220. [Accepted]

Closes #100880.

Collaborator

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

labels

May 6, 2023

Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

EFanZh

changed the title Implement From<{&,&mut} [T; N]> for Vec<T>

Implement From<{&,&mut} [T; N]> for Vec<T> where T: Clone

May 6, 2023

As the bot mentions, this will need to go through an ACP first...

@rustbot label +T-libs-api -T-libs

@rustbot author

rustbot

added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

May 6, 2023

Mark-Simulacrum

added the needs-fcp This change is insta-stable, so needs a completed FCP to proceed. label

May 6, 2023

Contributor

Author

@rustbot ready

rustbot

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

labels

May 7, 2023

Mark-Simulacrum

added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label).

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

May 7, 2023

Amanieu

added S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete.

and removed S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label).

labels

May 30, 2023

Contributor

☔ The latest upstream changes (presumably #113113) made this pull request unmergeable. Please resolve the merge conflicts.

bors

added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label

Jul 14, 2023

This comment has been minimized.

Dylan-DPC

added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

and removed S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

labels

Aug 12, 2023

r? @Amanieu -- rust-lang/libs-team#220 (comment) seems to be an accept, but I think this is insta-stable, right? So I was expecting an FCP not just a meeting discussion.

Member

We already accepted the ACP for this.

@rfcbot fcp merge

rfcbot

commented

Aug 13, 2023

edited by BurntSushi

Team member @Amanieu 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.

rfcbot

added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it.

labels

Aug 13, 2023

rfcbot

added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label

Aug 22, 2023

🔔 This is now entering its final comment period, as per the review above. 🔔

rfcbot

removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label

Aug 22, 2023

rfcbot

added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting

and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised.

labels

Sep 1, 2023

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

apiraino

removed the to-announce Announce this issue on triage meeting label

Sep 7, 2023

Member

@dtolnay dtolnay

left a comment

Thanks!

Member

@bors r+

Contributor

📌 Commit 27e10e2 has been approved by dtolnay

It is now in the queue for this repository.

bors

added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

labels

Sep 28, 2023

Contributor

⌛ Testing commit 27e10e2 with merge aeaa5c3...

Contributor

☀️ Test successful - checks-actions
Approved by: dtolnay
Pushing aeaa5c3 to master...

bors

added the merged-by-bors This PR was explicitly merged by bors label

Sep 28, 2023

bors

merged commit aeaa5c3 into

rust-lang:master

Sep 28, 2023

12 checks passed

EFanZh

deleted the implement-from-array-refs-for-vec branch

September 28, 2023 06:40

Collaborator

Finished benchmarking commit (aeaa5c3): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.3%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 631.789s -> 631.947s (0.03%)
Artifact size: 317.34 MiB -> 317.35 MiB (0.00%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

dtolnay

dtolnay approved these changes
Assignees

dtolnay

Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. merged-by-bors This PR was explicitly merged by bors needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects

None yet

Milestone

1.74.0

Development

Successfully merging this pull request may close these issues.

Implement From<&[T; N]> and From<&mut [T; N]> for Vec<T> where T: Clone?

11 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK