Skip to content

fix warning about hidden lifetime in values_mut#49

Merged
LukasKalbertodt merged 1 commit intoLukasKalbertodt:masterfrom
roeeshoshani:bugfix/values_mut_hidden_lifetime_warning
Mar 7, 2026
Merged

fix warning about hidden lifetime in values_mut#49
LukasKalbertodt merged 1 commit intoLukasKalbertodt:masterfrom
roeeshoshani:bugfix/values_mut_hidden_lifetime_warning

Conversation

@roeeshoshani
Copy link
Contributor

running cargo check on the current master with a new rust version yields the following warning:

    Checking stable-vec v0.4.1 (/.../stable-vec)
warning: hiding a lifetime that's elided elsewhere is confusing
   --> src/lib.rs:740:23
    |
740 |     pub fn values_mut(&mut self) -> ValuesMut<T, C> {
    |                       ^^^^^^^^^     ^^^^^^^^^^^^^^^ the same lifetime is hidden here
    |                       |
    |                       the lifetime is elided here
    |
    = help: the same lifetime is referred to in inconsistent ways, making the signature confusing
    = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default
help: use `'_` for type paths
    |
740 |     pub fn values_mut(&mut self) -> ValuesMut<'_, T, C> {
    |                                               +++

warning: `stable-vec` (lib) generated 1 warning (run `cargo fix --lib -p stable-vec` to apply 1 suggestion)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.05s

fix the warning by adding the missing '_.

@LukasKalbertodt LukasKalbertodt merged commit edd5b57 into LukasKalbertodt:master Mar 7, 2026
0 of 5 checks passed
@LukasKalbertodt
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants