algbio / ggcat

Compacted and colored de Bruijn graph construction and querying
MIT License
73 stars 10 forks source link

Error compiling using latest rust version #26

Closed rickbeeloo closed 1 year ago

rickbeeloo commented 1 year ago

When compiling using the latest nightly build:

   Compiling ggcat_querier v0.1.1 (../ggcat/crates/querier)
error: to use a constant of type `TypeId` in a pattern, `TypeId` must be annotated with `#[derive(PartialEq, Eq)]`
   --> crates/assembler_minimizer_bucketing/src/lib.rs:212:1
    |
212 | / #[dynamic_dispatch(H = [
213 | |     hashes::cn_nthash::CanonicalNtHashIteratorFactory,
214 | |     #[cfg(not(feature = "devel-build"))] hashes::fw_nthash::ForwardNtHashIteratorFactory
215 | | ], CX = [
216 | |     #[cfg(not(feature = "devel-build"))] colors::bundles::multifile_building::ColorBundleMultifileBuilding,
217 | |     colors::non_colored::NonColoredManager,
218 | | ])]
    | |___^
    |
    = 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 attribute macro `dynamic_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)

Also with older nighly builds it raises an error (2022-12-01, 2023-03-01, 2023-04-01), namely the following:

   Compiling ggcat_structs v0.1.0 (../tools/ggcat/ggcat/crates/structs)
error[E0635]: unknown feature `impl_trait_in_assoc_type`
 --> crates/hashes/src/lib.rs:3:12
  |
3 | #![feature(impl_trait_in_assoc_type)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^

Any way to solve this, or does a specific rust version allow it to compile successfully?

Thanks :)

Indy2222 commented 1 year ago

I think this is related to https://github.com/rust-lang/rust/pull/103291

Guilucand commented 1 year ago

Hi, I fixed the problem by changing the TypeId match with a series of ifs.