-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
regression: type annotations needed for Box<_> #127343
Comments
We discussed this regression in today's @rust-lang/libs-api team meeting, and agree there's nothing to change on Rust's end. Those repos that have an old version of I would love if someone were interested in cataloguing all the "type annotations needed" type inference breakages resulting from the addition of a trait impl through the history of the standard library, and think about building static analysis that could forewarn about code that is at risk of becoming ambiguous (e.g. |
Time 0.3.27 fails to build with Rust 1.80.0, released today[0]. This updates time to 0.3.36, which successfully builds with Rust 1.80.0. [0] rust-lang/rust#127343 Fixes ClementTsang#1500 Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
The version of time that bottom 0.9.6 uses does not build with Rust 1.80.0[0][1]. This bumps time to 0.3.36 to address the issue. [0] ClementTsang/bottom#1500 [1] rust-lang/rust#127343 Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
The version of time that bottom 0.9.6 uses does not build with Rust 1.80.0[0][1]. This bumps time to 0.3.36 to address the issue. [0] ClementTsang/bottom#1500 [1] rust-lang/rust#127343 Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
Backward compatibility is difficult =( |
@ayushgupta0610 Answer is here: #127343 (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)).
…roken (!31) Due to new rustc builder v1.80, some package builds are broken (see rust-lang/rust#127343). This PR add difftastic configuration with a boolean switch between delta/difftastic and deactivate delta due to previously mentioned issues. Approved-by: Romain Deville <code@romaindeville.fr> Merged-by: Romain Deville <code@romaindeville.fr> See merge request https://framagit.org/rdeville-public/dotfiles/nixos-config/-/merge_requests/31
…e` dependency to build on 1.80.0 Our old nightly (1.65) pins `time-macros` to an old version, which requires `time` to stay on an old version. But since 1.80 broke `time` (due to time-rs/time#693 and rust-lang/rust#127343), we need to update `time`. Doing this requires `time-macros` to be upgraded, which requires at least rust 1.67. There's an old PR, #811, for this, but it needs rebasing. So for now, removing `git-testament` and its `time` dependency is simpler, and we can add it back later once we update to a newer nightly.
…e` dependency to build on 1.80.0 (#1115) * Fixes #1109. Our old nightly (1.65) pins `time-macros` to an old version, which requires `time` to stay on an old version. But since 1.80 broke `time` (due to time-rs/time#693 and rust-lang/rust#127343), we need to update `time`. Doing this requires `time-macros` to be upgraded, which requires at least rust 1.67. There's an old PR, #811, for this, but it needs rebasing. So for now, removing `git-testament` and its `time` dependency is simpler, and we can add it back later once we update to a newer nightly. With this fix, both `cargo build -p c2rust` (the pinned nightly) and `cargo +stable build -p c2rust` (1.80.1) now work. If this is good, and once we merge this, we'll release a new version with the fix.
``` error[E0282]: type annotations needed for `Box<_>` --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on crate `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.35` ``` Partially address rust-lang#127343.
Emit specific message for time<=0.3.35 ``` error[E0282]: type annotations needed for `Box<_>` --> /home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.36` ``` Partially mitigate the fallout from rust-lang#127343. Although the biggest benefit of this would have been if we had had this in 1.80 before it became stable, the long-tail of that change will be felt for a *long* time, so better late than never. We can also emit an even more targeted error instead of this inference failure.
Emit specific message for time<=0.3.35 ``` error[E0282]: type annotations needed for `Box<_>` --> /home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.36` ``` Partially mitigate the fallout from rust-lang#127343. Although the biggest benefit of this would have been if we had had this in 1.80 before it became stable, the long-tail of that change will be felt for a *long* time, so better late than never. We can also emit an even more targeted error instead of this inference failure.
Rollup merge of rust-lang#129343 - estebank:time-version, r=jieyouxu Emit specific message for time<=0.3.35 ``` error[E0282]: type annotations needed for `Box<_>` --> /home/gh-estebank/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.36` ``` Partially mitigate the fallout from rust-lang#127343. Although the biggest benefit of this would have been if we had had this in 1.80 before it became stable, the long-tail of that change will be felt for a *long* time, so better late than never. We can also emit an even more targeted error instead of this inference failure.
``` error[E0282]: type annotations needed for `Box<_>` --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on crate `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.35` ``` Partially address rust-lang#127343. (cherry picked from commit b013a3d)
resctl-demo v2.2.5 (crates.io) uses time v0.3.34, which fails to build on rust >= 1.8.0 (rust-lang/rust#127343). Fix the toolchain version to 1.79.0 until a new resctl-demo version is released. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
resctl-demo v2.2.5 (crates.io) uses time v0.3.34, which fails to build on rust >= 1.8.0 (rust-lang/rust#127343). Fix the toolchain version to 1.79.0 until a new resctl-demo version is released. Signed-off-by: Ricardo Cañuelo <ricardo.canuelo@collabora.com>
``` error[E0282]: type annotations needed for `Box<_>` --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/time-0.3.34/src/format_description/parse/mod.rs:83:9 | 83 | let items = format_items | ^^^^^ ... 86 | Ok(items.into()) | ---- type must be known at this point | = note: this is an inference error on crate `time` caused by a change in Rust 1.80.0; update `time` to version `>=0.3.35` ``` Partially address rust-lang#127343. (cherry picked from commit b013a3d)
…e` dependency to build on 1.80.0 (immunant#1115) * Fixes immunant#1109. Our old nightly (1.65) pins `time-macros` to an old version, which requires `time` to stay on an old version. But since 1.80 broke `time` (due to time-rs/time#693 and rust-lang/rust#127343), we need to update `time`. Doing this requires `time-macros` to be upgraded, which requires at least rust 1.67. There's an old PR, immunant#811, for this, but it needs rebasing. So for now, removing `git-testament` and its `time` dependency is simpler, and we can add it back later once we update to a newer nightly. With this fix, both `cargo build -p c2rust` (the pinned nightly) and `cargo +stable build -p c2rust` (1.80.1) now work. If this is good, and once we merge this, we'll release a new version with the fix.
Required to build with Rust 1.80. Link: rust-lang/rust#127343
Mostly reverse-dependencies of the
time
crate (before time-rs/time@5b0c627, released in 0.3.35). My sense is there's probably nothing to do here, but lots of crates have older version of time in Cargo.lock. Nominating for libs-api to approve the wide spectrum of regressions. (Caused by #99969).The text was updated successfully, but these errors were encountered: