colinjneville / triangulate

A Rust library for subdividing polygons into triangles
MIT License
14 stars 3 forks source link

Crate no longer compiles with version 1.81.0 #4

Open Nahuel-M opened 1 month ago

Nahuel-M commented 1 month ago

While rustc 1.80.0 compiles without issues, rustc 1.81.0 gives the following error:

   Compiling triangulate v0.2.0
error[E0275]: overflow evaluating the requirement `<OldIndex as Mappable<_>>::Output<_>: Mappable<_>`
   --> dir\.cargo\registry\src\index.crates.io-6f17d22bba15001f\triangulate-0.2.0\src\inputs\polygon_list.rs:489:9
    |
489 |         IndexWithIter::new(self.0.iter_indices())
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`triangulate`)      
note: required by a bound in `IndexWithIter::<'i, Iter, OldIndex, New, Old>::new`
   --> dir\.cargo\registry\src\index.crates.io-6f17d22bba15001f\triangulate-0.2.0\src\inputs\polygon_list.rs:397:63
    |
397 |     OldIndex::Output<New>: VertexIndex + crate::Mappable<New, Output<Old> = OldIndex>,
    |                                                               ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `IndexWithIter::<'i, Iter, OldIndex, New, Old>::new`
398 | {
399 |     pub(crate) fn new(iter: Iter) -> Self {
    |                   --- required by a bound in this associated function

For more information about this error, try `rustc --explain E0275`.
error: could not compile `triangulate` (lib) due to 1 previous error

I looked into fixing this myself, but I'm out of my depth with the trait complexity of this part of the library.

yzobus commented 1 month ago

Facing the same issue.

colinjneville commented 1 week ago

Sorry for the delayed response! The compiler change (rust-lang/rust#126128) that resulted in this breakage has a followup (rust-lang/rust#129073) landing in 1.83 (November 28) that makes this work again.
In the meantime, you can use the beta toolchain:
rustup toolchain install beta
cargo +beta build