-
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
alloc: implement FromIterator for Box<str> #99969
Conversation
r? @kennytm (rust-highfive has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
@rustbot label +T-libs-api -T-libs |
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 |
d456168
to
55ba9e7
Compare
@rustbot label +S-waiting-on-review -S-waiting-on-author |
@rust-lang/libs-api: + 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 |
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. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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
`rustc --version`: `v1.80.0` has a type inference regression. This causes compilation of `centerpiece` to fail, because we use an affected version of the `time` crate. This updates the time crate to a released version with a fix. Reference: - NixOS/nixpkgs#332957 - rust-lang/rust#125319 - rust-lang/rust#99969
`rustc --version`: `v1.80.0` has a type inference regression. This causes compilation of `centerpiece` to fail, because we use an affected version of the `time` crate. This updates the time crate to a released version with a fix. Reference: - NixOS/nixpkgs#332957 - rust-lang/rust#125319 - rust-lang/rust#99969
It seems this did not make it into the "Compatibility Notes" for https://doc.rust-lang.org/nightly/releases.html#version-1800-2024-07-25. @apiraino could it be retroactively added? (coming here from the IRLO discussion https://internals.rust-lang.org/t/type-inference-breakage-in-1-80-has-not-been-handled-well) |
Thanks Trevor for the ping. Relayed to T-release on Zulip. |
…r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? `@rust-lang/release`
…r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? ``@rust-lang/release``
…r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? ```@rust-lang/release```
…r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? ````@rust-lang/release````
…r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? `````@rust-lang/release`````
…r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? ``````@rust-lang/release``````
Rollup merge of rust-lang#129263 - apiraino:add-missing-compat-note, r=cuviper Add a missing compatibility note in the 1.80.0 release notes rust-lang#99969 missed being included in the release notes. As discussed [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/.2399969.20missed.20the.20release.20notes/near/463002451). (the discussion about the _a posteriori_ breakage the ecosystem is experiencing is another topic) Thanks r? ``````@rust-lang/release``````
Rust `1.80.0` introduced a [new trait implementation](rust-lang/rust#99969) which caused builds of [old versions of the `time` crate to fail](rust-lang/rust#127343). Since `cargo clone` depends on one of these old `time` versions, build with rust `1.80.0` or later fail: ``` error[E0282]: type annotations needed for `Box<_>` --> /home/ethan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.30/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | help: consider giving `items` an explicit type, where the placeholders `_` are specified | 83 | let items: Box<_> = format_items | ++++++++ For more information about this error, try `rustc --explain E0282`. error: could not compile `time` (lib) due to 1 previous error ``` Updating to a version of time with this regression fixed, with `cargo update -p time`, fixes the build of `cargo clone`. It would also be helpful to get a new release of `cargo clone` after this is merged, since this is also causing the `cargo clone` package to [fail on NixOS](NixOS/nixpkgs#332957 (comment)).
Rust `1.80.0` introduced a [new trait implementation](rust-lang/rust#99969) which caused builds of [old versions of the `time` crate to fail](rust-lang/rust#127343). Since `cargo clone` depends on one of these old `time` versions, builds with rust `1.80.0` or later fail: ``` error[E0282]: type annotations needed for `Box<_>` --> /home/ethan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.30/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | help: consider giving `items` an explicit type, where the placeholders `_` are specified | 83 | let items: Box<_> = format_items | ++++++++ For more information about this error, try `rustc --explain E0282`. error: could not compile `time` (lib) due to 1 previous error ``` Updating to a version of time with this regression fixed, with `cargo update -p time`, fixes the build of `cargo clone`. It would also be helpful to get a new release of `cargo clone` after this is merged, since this is also causing the `cargo clone` package to [fail on NixOS](NixOS/nixpkgs#332957 (comment)).
Rust `1.80.0` introduced a [new trait implementation](rust-lang/rust#99969) which caused builds of [old versions of the `time` crate to fail](rust-lang/rust#127343). Since `cargo clone` depends on one of these old `time` versions, builds with rust `1.80.0` or later fail: ``` error[E0282]: type annotations needed for `Box<_>` --> /home/ethan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.30/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | help: consider giving `items` an explicit type, where the placeholders `_` are specified | 83 | let items: Box<_> = format_items | ++++++++ For more information about this error, try `rustc --explain E0282`. error: could not compile `time` (lib) due to 1 previous error ``` Updating to a version of time with this regression fixed, with `cargo update -p time`, fixes the build of `cargo clone`. It would also be helpful to get a new release of `cargo clone` after this is merged, since this is also causing the `cargo clone` package to [fail on NixOS](NixOS/nixpkgs#332957 (comment)).
This updates the time crate to a version >= 0.3.35, which will compile again on rustc >= 1.80.0. See also: rust-lang/rust#99969 rust-lang/rust#127343 time-rs/time#693
By running `cargo update time`, this PR updates the time crate to a version >= 0.3.35, meaning it will compile again on rustc >= 1.80.0. See also: rust-lang/rust#99969 rust-lang/rust#127343 time-rs/time#693
By running `cargo update time`, this PR updates the time crate to a version >= 0.3.35, meaning it will compile again on rustc >= 1.80.0. See also: rust-lang/rust#99969 rust-lang/rust#127343 time-rs/time#693
By running `cargo update time`, this PR updates the time crate to a version >= 0.3.35, meaning it will compile again on rustc >= 1.80.0. See also: rust-lang/rust#99969 rust-lang/rust#127343 time-rs/time#693
Box<[T]>
implementsFromIterator<T>
usingVec<T>
+into_boxed_slice()
.Add analogous
FromIterator
implementations forBox<str>
matching the current implementations for
String
.Remove the
Global
allocator requirement forFromIterator<Box<str>>
too.ACP: rust-lang/libs-team#196