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
error[E0309]: the parameter type `V` may not live long enough
--> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xot-0.22.0/src/nodemap/core.rs:100:9
|
37 | impl<'a, K, V, A: ValueAdapter<K, V>> NodeMap<'a, K, V, A>
| -- the parameter type `V` must be valid for the lifetime `'a` as defined here...
...
100 | / self.iter_value()
101 | | .map(|value| (A::key(value), A::value(value)))
| |__________________________________________________________^ ...so that the type `V` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
40 | V: Clone + 'a,
| ++++
error[E0309]: the parameter type `V` may not live long enough
--> /home/$USER/.cargo/registry/src/index.crates.io-6f17d22bba15001f/xot-0.22.0/src/nodemap/core.rs:116:9
|
37 | impl<'a, K, V, A: ValueAdapter<K, V>> NodeMap<'a, K, V, A>
| -- the parameter type `V` must be valid for the lifetime `'a` as defined here...
...
116 | self.iter_value().map(move |value| A::value(value))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `V` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
40 | V: Clone + 'a,
| ++++
For more information about this error, try `rustc --explain E0309`.
error: could not compile `xot` (lib) due to 2 previous errors
&'a V in -> impl Iterator<Item = &'a V> doesn't create implied lifetime bounds or have its WF-ness checked (rust-lang/rust#110925). Since &'a V appears in the function body and the concrete return type anyway, V: 'a has to be verified to prove its WF-ness, which didn't happen until rust-lang/rust#120019.
MutableNodeMap::{iter,values} don't need V: 'a because the parameters &'a self (self: &'a MutableNodeMap<'a, K, V, A>) already imply V: 'a.
Thanks! I've followed the suggestion and added a 'a and after that it compiles again. I've made a new release, 0.23, which also has various changes and new features concerning serialization I still had to release.
xot/src/nodemap/core.rs
Lines 99 to 102 in 6fbd052
xot/src/nodemap/core.rs
Lines 115 to 117 in 6fbd052
The text was updated successfully, but these errors were encountered: