Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy elidable_lifetime_names lint #413

Merged
merged 2 commits into from
Mar 3, 2025
Merged

Clippy elidable_lifetime_names lint #413

merged 2 commits into from
Mar 3, 2025

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Mar 3, 2025

No description provided.

dtolnay added 2 commits March 2, 2025 19:52
    warning: the following explicit lifetimes could be elided: 'a
      --> src/aserror.rs:47:6
       |
    47 | impl<'a> Sealed for dyn Error + 'a {}
       |      ^^                         ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
       = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
       |
    47 - impl<'a> Sealed for dyn Error + 'a {}
    47 + impl Sealed for dyn Error + '_ {}
       |

    warning: the following explicit lifetimes could be elided: 'a
      --> src/aserror.rs:48:6
       |
    48 | impl<'a> Sealed for dyn Error + Send + 'a {}
       |      ^^                                ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
       |
    48 - impl<'a> Sealed for dyn Error + Send + 'a {}
    48 + impl Sealed for dyn Error + Send + '_ {}
       |

    warning: the following explicit lifetimes could be elided: 'a
      --> src/aserror.rs:49:6
       |
    49 | impl<'a> Sealed for dyn Error + Send + Sync + 'a {}
       |      ^^                                       ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
       |
    49 - impl<'a> Sealed for dyn Error + Send + Sync + 'a {}
    49 + impl Sealed for dyn Error + Send + Sync + '_ {}
       |

    warning: the following explicit lifetimes could be elided: 'a
      --> src/aserror.rs:50:6
       |
    50 | impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {}
       |      ^^                                                    ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
    help: elide the lifetimes
       |
    50 - impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {}
    50 + impl Sealed for dyn Error + Send + Sync + UnwindSafe + '_ {}
       |
    warning: the following explicit lifetimes could be elided: 'a
     --> src/var.rs:5:6
      |
    5 | impl<'a, T: Pointer + ?Sized> Pointer for Var<'a, T> {
      |      ^^                                       ^^
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
      = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
      = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
      |
    5 - impl<'a, T: Pointer + ?Sized> Pointer for Var<'a, T> {
    5 + impl<T: Pointer + ?Sized> Pointer for Var<'_, T> {
      |

    warning: the following explicit lifetimes could be elided: 'a
      --> tests/test_lints.rs:40:22
       |
    40 |     pub enum MyError<'a> {
       |                      ^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
       = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
       |
    40 -     pub enum MyError<'a> {
    40 +     pub enum MyError'_> {
       |

    warning: the following explicit lifetimes could be elided: 'a
       --> tests/test_display.rs:157:14
        |
    157 |         impl<'a> Display for Msg<'a> {
        |              ^^                  ^^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#elidable_lifetime_names
        = note: `-W clippy::elidable-lifetime-names` implied by `-W clippy::pedantic`
        = help: to override `-W clippy::pedantic` add `#[allow(clippy::elidable_lifetime_names)]`
    help: elide the lifetimes
        |
    157 -         impl<'a> Display for Msg<'a> {
    157 +         impl Display for Msg<'_> {
        |
@dtolnay dtolnay merged commit 76490f7 into master Mar 3, 2025
20 checks passed
@dtolnay dtolnay deleted the elidablelifetime branch March 3, 2025 04:23
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.

1 participant