lending-iterator.rs
lending-iterator.rs copied to clipboard
MSRV Doesn't seem right
Hey there, awesome package! I have a quick question about the MSRV.
I'm following the docs to impl LendingIterator for my own type, where in the docs it mentions:
trait LendingIterator {
type Item<'next>
where
Self : 'next,
;
...
For my type I've implemented
#[gat]
impl<'db> LendingIterator for ReadHalf<'db> {
type Item<'next> = PsrdadaResult<&'next [i8]>
where
Self: 'next;
...
This works fine in Rust 1.61.0, but anything earlier (down to your stated MSRV of 1.57.0) I get
error: expected one of `!`, `+`, `::`, or `;`, found keyword `where`
--> /home/kiran/.cargo/git/checkouts/psrdada-rs-960163a6f839822c/489137d/src/lib.rs:286:5
|
284 | impl<'db> LendingIterator for ReadHalf<'db> {
| - while parsing this item list starting here
285 | type Item<'next> = PsrdadaResult<&'next [i8]>
| - expected one of `!`, `+`, `::`, or `;`
286 | where
| ^^^^^ unexpected token
...
332 | }
| - the item list ends here
Any help would be appreciated.
I got rid of the where line and things seem to work fine, so disregard. Haha.
Hmm reopening since this indeed should not happen. I think the issue is that the order/location of the where clause evolved, and you are using the more recent one: could you try doing something like:
type Item<'next>
where
Self : 'next,
=
PsrdadaResult<&'next [i8]>
;
If it works with that, then you can indeed close as completed 🙂 else, I'll look into it.
- (it is true that you can currently skip the bound altogether, but this is a "bug" with the current implementation of
#[gat], so it's better not to, in order to ease some future transition to a macro-less version)