// Uncomment this line and this fails to build (with itertools 0.13.0, works with 0.12.1)
// use itertools::Itertools;
#[derive(Debug, strum::EnumIter)]
enum A {
B,
C,
}
This leads to the very strange following error if the mentioned line is uncommented:
Compiling itertools_strum v0.1.0 (/home/arvid/src/itertools_strum)
error[E0277]: the trait bound `usize: IteratorIndex<&mut AIter>` is not satisfied
--> src/main.rs:4:17
|
4 | #[derive(Debug, strum::EnumIter)]
| ^^^^^^^^^^^^^^^ the trait `IteratorIndex<&mut AIter>` is not implemented for `usize`
|
= help: the following other types implement trait `IteratorIndex<I>`:
RangeFull
std::ops::Range<usize>
RangeFrom<usize>
RangeTo<usize>
RangeInclusive<usize>
RangeToInclusive<usize>
note: required by a bound in `itertools::Itertools::get`
--> /home/arvid/.cargo/registry/src/index.crates.io-6f17d22bba15001f/itertools-0.13.0/src/lib.rs:554:12
|
551 | fn get<R>(self, index: R) -> R::Output
| --- required by a bound in this associated function
...
554 | R: traits::IteratorIndex<Self>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Itertools::get`
= note: this error originates in the derive macro `strum::EnumIter` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0277`.
error: could not compile `itertools_strum` (bin "itertools_strum") due to 2 previous errors
This leads to the very strange following error if the mentioned line is uncommented:
I have no idea if this is a strum or itertools bug. As such I have reported this to both, see https://github.com/rust-itertools/itertools/issues/942
Using rustc 1.78.0 (9b00956e5 2024-04-29).