sval-rs / value-bag

Dynamic structured values for Rust
Apache License 2.0
27 stars 3 forks source link

error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]` #65

Closed davehorner closed 1 year ago

davehorner commented 1 year ago

Today I updated to the latest stable 1.70 and my project fails to build now.

rustup check
stable-x86_64-pc-windows-msvc - Up to date : 1.70.0 (90c541806 2023-05-31)
nightly-x86_64-pc-windows-msvc - Up to date : 1.72.0-nightly (d59363ad0 2023-06-01)
rustup - Up to date : 1.26.0

value-bag dep is coming from my async-io dep.

├── async-std v1.12.0
│   │   ├── async-io v1.9.0
  1 │   │   │   ├── concurrent-queue v1.2.4 (*)
  2 │   │   │   ├── futures-lite v1.12.0 (*)
  3 │   │   │   ├── log v0.4.17
  4 │   │   │   │   ├── cfg-if v1.0.0
  5 │   │   │   │   └── value-bag v1.0.0-alpha.9
  6 │   │   │   │       └── ctor v0.1.23 (proc-macro)
  7 │   │   │   │           ├── quote v1.0.26 (*)
  8 │   │   │   │           └── syn v1.0.100 (*)
  9 │   │   │   │       [build-dependencies]
 10 │   │   │   │       └── version_check v0.9.4

Compiling now provides: error: to use a constant of type TypeId in a pattern, TypeId must be annotated with #[derive(PartialEq, Eq)]

   Compiling value-bag v1.0.0-alpha.9
   Compiling serde_derive v1.0.145
   Compiling miniz_oxide v0.5.4
   Compiling tracing-core v0.1.29
error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
  --> C:\Users\dhorner\.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)]`
  --> C:\Users\dhorner\.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)]`
  --> C:\Users\dhorner\.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
warning: build failed, waiting for other jobs to finish...

I noticed that I'm using value-bag in 1.0 alpha; not sure how to go about changing this dependency version. Let me know if you have any thoughts. Thanks.

davehorner commented 1 year ago

I did a cargo update. It is building now.