Skip to content

xot v0.22.0 fails to compile on Rust 1.77.0 #23

@kawadakk

Description

@kawadakk
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

xot/src/nodemap/core.rs

Lines 99 to 102 in 6fbd052

pub fn iter(&self) -> impl Iterator<Item = (K, &'a V)> + '_ {
self.iter_value()
.map(|value| (A::key(value), A::value(value)))
}

xot/src/nodemap/core.rs

Lines 115 to 117 in 6fbd052

pub fn values(&self) -> impl Iterator<Item = &'a V> + '_ {
self.iter_value().map(move |value| A::value(value))
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions