You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ratatui/ratatui#1120 dependabot brought in itertools 0.13. We have a dependency on strum and use the EnumIter derive macro. This fails to compile with itertools due to adding the .get method on the iterator (which clashes with an existing method on the iterator created by the derive macro.)
E.g.:
use itertools::Itertools;use strum::{Display,EnumIter,FromRepr,IntoEnumIterator};#[derive(Debug,Clone,Copy,Default,Display,EnumIter,FromRepr,PartialEq,Eq)]enumTab{#[default]About,Recipe,Email,Traceroute,Weather,}
Errors
error[E0277]: the trait bound `usize: IteratorIndex<&mut ConstraintNameIter>` is not satisfied
--> examples/constraint-explorer.rs:53:54
|
53 | #[derive(Debug, Default, Clone, Copy, PartialEq, Eq, EnumIter, FromRepr, Display)]
| ^^^^^^^^ the trait `IteratorIndex<&mut ConstraintNameIter>` 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`
--> /Users/joshka/.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 `EnumIter` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0277]: the trait bound `usize: IteratorIndex<&mut TabIter>` is not satisfied
--> examples/demo2/app.rs:30:48
|
30 | #[derive(Debug, Clone, Copy, Default, Display, EnumIter, FromRepr, PartialEq, Eq)]
| ^^^^^^^^ the trait `IteratorIndex<&mut TabIter>` 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`
--> /Users/joshka/.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 `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 `ratatui` (example "constraint-explorer") due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `ratatui` (example "demo2") due to 2 previous errors
I can work around this by just manually implementing the EnumIter trait from strum (it's an small shortcut), but I'd guess that this was unintentional. Naming a method get on a widely used extension trait intuitively seems like it might cause similar issues in many places. I'm not certain of this though, and it's possible I'm over-generalizing the failure mode from this one instance.
In ratatui/ratatui#1120 dependabot brought in itertools 0.13. We have a dependency on strum and use the EnumIter derive macro. This fails to compile with itertools due to adding the
.get
method on the iterator (which clashes with an existing method on the iterator created by the derive macro.)E.g.:
Errors
EnumIter macro expansion
I can work around this by just manually implementing the EnumIter trait from strum (it's an small shortcut), but I'd guess that this was unintentional. Naming a method
get
on a widely used extension trait intuitively seems like it might cause similar issues in many places. I'm not certain of this though, and it's possible I'm over-generalizing the failure mode from this one instance.Caused by #891 and #447
The text was updated successfully, but these errors were encountered: