Skip to content

Fix mismatched_lifetime_syntaxes warning #652

@jschwe

Description

@jschwe

When compiling mozjs with stable rust mismatched_lifetime_syntaxes is now warn by default.

warning: hiding a lifetime that's elided elsewhere is confusing
   --> mozjs/src/gc/collections.rs:128:19
    |
128 |     pub fn handle(&self) -> Handle<T> {
    |                   ^^^^^     ^^^^^^^^^ 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
    |
128 |     pub fn handle(&self) -> Handle<'_, T> {
    |                                    +++

To reproduce:

cargo +stable build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions