async-rs / async-std

Async version of the Rust standard library

Home Page:https://async.rs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build failing on latest nightly

Bathtor opened this issue · comments

It looks like the build is failing on rustc 1.71.0-nightly (1a5f8bce7 2023-05-26), because of an issue in the transitive value-bag dependency (via async-io):

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /Users/lkroll/.cargo/registry/src/index.crates.io-6f17d22bba15001f/value-bag-1.0.0-alpha.9/src/internal/cast/primitive.rs:43:33
   |
43 |                                   $const_ident => |v| Some(Internal::from(unsafe { &*(*v as *const Self as *const $ty) })),
   |                                   ^^^^^^^^^^^^
...
71 | /         to_internal![
72 | |             usize: (USIZE, OPTION_USIZE),
73 | |             u8: (U8, OPTION_U8),
74 | |             u16: (U16, OPTION_U16),
...  |
96 | |             String: (STRING, OPTION_STRING),
97 | |         ];
   | |_________- in this macro invocation
   |
   = note: the traits must be derived, manual `impl`s are not sufficient
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
   = note: this error originates in the macro `to_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /Users/lkroll/.cargo/registry/src/index.crates.io-6f17d22bba15001f/value-bag-1.0.0-alpha.9/src/internal/cast/primitive.rs:46:33
   |
46 |                                   $option_ident => |v| Some({
   |                                   ^^^^^^^^^^^^^
...
71 | /         to_internal![
72 | |             usize: (USIZE, OPTION_USIZE),
73 | |             u8: (U8, OPTION_U8),
74 | |             u16: (U16, OPTION_U16),
...  |
96 | |             String: (STRING, OPTION_STRING),
97 | |         ];
   | |_________- in this macro invocation
   |
   = note: the traits must be derived, manual `impl`s are not sufficient
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
   = note: this error originates in the macro `to_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> /Users/lkroll/.cargo/registry/src/index.crates.io-6f17d22bba15001f/value-bag-1.0.0-alpha.9/src/internal/cast/primitive.rs:55:29
   |
55 |                               STR => |v| Some(Internal::from(unsafe { &**(v as *const &'a Self as *const &'a str) })),
   |                               ^^^
...
71 | /         to_internal![
72 | |             usize: (USIZE, OPTION_USIZE),
73 | |             u8: (U8, OPTION_U8),
74 | |             u16: (U16, OPTION_U16),
...  |
96 | |             String: (STRING, OPTION_STRING),
97 | |         ];
   | |_________- in this macro invocation
   |
   = note: the traits must be derived, manual `impl`s are not sufficient
   = note: see https://doc.rust-lang.org/stable/std/marker/trait.StructuralEq.html for details
   = note: this error originates in the macro `to_internal` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `value-bag` (lib) due to 3 previous errors

Funny thing is: I can't reproduce this failure building either async-io or log (which is what pulls in value-bag) directly.
Anyone got any idea what's going on there?

Seems likely related to rust-lang/rust#103291, which just merged

Yup, but I don't understand why it's not failing when building async-io or log with the same Rust version. Only fails when building async-std and above (with default features so it pulls in async-io as a dependency).

Got the same error. Seems caused by upstream.

You likely need to run cargo update to pick up log v0.4.7

Nope, it's already picking that up and the issue is till happening:

$ cargo tree | grep log
│   │   ├── log v0.4.17
│   │   │   └── log v0.4.17 (*)
│   │   └── log v0.4.17 (*)
├── kv-log-macro v1.0.7
│   └── log v0.4.17 (*)
├── log v0.4.17 (*)
│   ├── log v0.4.17 (*)

I think it's only fixed in the master branch, log v0.4.17 depends on older version of value-bag: https://github.com/rust-lang/log/blob/7fb28c36c7a418912612ab37ab49bd4ca1a3a7f5/Cargo.toml#L66

I think it's only fixed in the master branch, log v0.4.17 depends on older version of value-bag: https://github.com/rust-lang/log/blob/7fb28c36c7a418912612ab37ab49bd4ca1a3a7f5/Cargo.toml#L66

Oh true! I thought 0.4.17 was earlier this month but it's a year old and there hasn't been a log release since then. Looks like the kv_unstable feature proved to be especially unstable

They released 0.4.18 a couple of hours ago, which fixes the issue.

I'm going to close this issue, then. Thanks everyone :)