Skip to content
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

alloc: implement FromIterator for Box<str> #99969

Merged
merged 1 commit into from
May 19, 2024

Conversation

calebsander
Copy link
Contributor

@calebsander calebsander commented Jul 30, 2022

Box<[T]> implements FromIterator<T> using Vec<T> + into_boxed_slice().
Add analogous FromIterator implementations for Box<str>
matching the current implementations for String.
Remove the Global allocator requirement for FromIterator<Box<str>> too.

ACP: rust-lang/libs-team#196

@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Jul 30, 2022

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

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jul 30, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 30, 2022
@calebsander
Copy link
Contributor Author

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

@rustbot rustbot added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 30, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 8, 2022
@pitaj
Copy link
Contributor

pitaj commented Jan 29, 2023

I believe this does require an ACP (insta-stable new implementation of stable trait on stable type). Please create one if you haven't already. Link it here and then label this PR as S-waiting-on-ACP.

@rustbot label -S-waiting-on-review +S-waiting-on-author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2023
@calebsander
Copy link
Contributor Author

ACP: rust-lang/libs-team#196

@calebsander
Copy link
Contributor Author

@rustbot label +S-waiting-on-review -S-waiting-on-author

@rustbot 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 Mar 25, 2023
@Dylan-DPC Dylan-DPC added S-waiting-on-ACP Status: PR has an ACP and is waiting for the ACP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 14, 2023
@dtolnay dtolnay assigned dtolnay and unassigned kennytm Jan 26, 2024
@dtolnay
Copy link
Member

dtolnay commented Jan 26, 2024

@rust-lang/libs-api:
@rfcbot fcp merge

+ impl FromIterator<char> for Box<str>
+ impl FromIterator<&char> for Box<str>
+ impl FromIterator<&str> for Box<str>
+ impl FromIterator<String> for Box<str>
+ impl<A: Allocator> FromIterator<Box<str, A>> for Box<str>
+ impl FromIterator<Cow<'_, str>> for Box<str>

- impl FromIterator<Box<str>> for String
+ impl<A: Allocator> FromIterator<Box<str, A>> for String

- impl Extend<Box<str>> for String
+ impl<A: Allocator> Extend<Box<str, A>> for String

@rfcbot
Copy link

rfcbot commented Jan 26, 2024

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.

@rfcbot 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 Jan 26, 2024
@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Mar 5, 2024
@rfcbot
Copy link

rfcbot commented Mar 5, 2024

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

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 18, 2024
…r=dtolnay

alloc: implement FromIterator for Box<str>

`Box<[T]>` implements `FromIterator<T>` using `Vec<T>` + `into_boxed_slice()`.
Add analogous `FromIterator` implementations for `Box<str>`
matching the current implementations for `String`.
Remove the `Global` allocator requirement for `FromIterator<Box<str>>` too.

ACP: rust-lang/libs-team#196
@bors
Copy link
Contributor

bors commented May 18, 2024

⌛ Testing commit c92c228 with merge ce8c2dc...

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling rustc_lint v0.0.0 (/checkout/compiler/rustc_lint)
[RUSTC-TIMING] rustc_metadata test:false 43.201
   Compiling rustc_ty_utils v0.0.0 (/checkout/compiler/rustc_ty_utils)

Session terminated, killing shell...::group::Clock drift check
##[error]The runner has received a shutdown signal. This can happen when the runner service is stopped, or a manually started runner is canceled.
  network time: Sun, 19 May 2024 00:01:52 GMT
##[endgroup]
 ...killed.
##[error]The operation was canceled.

@bors
Copy link
Contributor

bors commented May 19, 2024

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 19, 2024
@dtolnay
Copy link
Member

dtolnay commented May 19, 2024

Can't tell what failed.

@bors retry

@bors 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 May 19, 2024
@bors
Copy link
Contributor

bors commented May 19, 2024

⌛ Testing commit c92c228 with merge bfa3635...

@bors
Copy link
Contributor

bors commented May 19, 2024

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 19, 2024
@bors bors merged commit bfa3635 into rust-lang:master May 19, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 19, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (bfa3635): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results (primary 4.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.1% [4.0%, 4.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.1% [4.0%, 4.2%] 2

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: 667.801s -> 671.223s (0.51%)
Artifact size: 316.10 MiB -> 316.05 MiB (-0.01%)

@calebsander calebsander deleted the feature/collect-box-str branch May 19, 2024 17:05
kpreid added a commit to kpreid/all-is-cubes that referenced this pull request May 21, 2024
The locked version no longer compiles on nightly due to
<rust-lang/rust#99969>.
kpreid added a commit to kpreid/all-is-cubes that referenced this pull request May 22, 2024
The locked version no longer compiles on nightly due to
<rust-lang/rust#99969>.
stevenengler added a commit to stevenengler/shadow that referenced this pull request May 22, 2024
Previously shadow wouldn't compile on nightly due to a rust type inference
change that breaks older rust code, and they intend to stabilize this change.
For us that breakage occurs in the time crate, so this PR upgrades all
dependencies (including the time library) to fix the build errors.

rust-lang/rust#99969 (comment)

rust-lang/rust#125319
stevenengler added a commit to stevenengler/shadow that referenced this pull request May 22, 2024
Previously shadow wouldn't compile on nightly due to a rust type inference
change that breaks existing rust code, and they intend to stabilize this
change. For us that breakage occurs in the time crate, so this PR upgrades all
dependencies (including the time library) to fix the build errors.

rust-lang/rust#99969 (comment)

rust-lang/rust#125319
stevenengler added a commit to stevenengler/shadow that referenced this pull request May 23, 2024
Previously shadow wouldn't compile on nightly due to a rust type inference
change that breaks existing rust code, and they intend to stabilize this
change. For us that breakage occurs in the time crate, so this PR upgrades all
dependencies (including the time library) to fix the build errors.

rust-lang/rust#99969 (comment)

rust-lang/rust#125319
stevenengler added a commit to shadow/shadow that referenced this pull request May 24, 2024
Previously shadow wouldn't compile on nightly due to a rust compiler
type inference change that breaks existing rust code, and they intend to
stabilize this change in a couple of months. For us that breakage occurs
in the time crate, so this PR upgrades all dependencies (including the
time library) to fix the build error.

rust-lang/rust#99969 (comment)

rust-lang/rust#125319
@apiraino
Copy link
Contributor

apiraino commented Jun 19, 2024

Adding relnotes label because someone reported this in #126685 (up to t-release to decide)

@rustbot label +relnotes

@rustbot rustbot added the relnotes Marks issues that should be documented in the release notes of the next release. label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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. relnotes Marks issues that should be documented in the release notes of the next release. 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
Development

Successfully merging this pull request may close these issues.

None yet