Resolve some elidable_lifetime_names pedantic clippy lint

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 + '_ {}
       |
This commit is contained in:
David Tolnay 2025-03-02 19:52:17 -08:00
parent 5f07160c35
commit daf2a6f36e
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82

View file

@ -44,7 +44,7 @@ impl<'a> AsDynError<'a> for dyn Error + Send + Sync + UnwindSafe + 'a {
#[doc(hidden)]
pub trait Sealed {}
impl<T: Error> Sealed for T {}
impl<'a> Sealed for dyn Error + 'a {}
impl<'a> Sealed for dyn Error + Send + 'a {}
impl<'a> Sealed for dyn Error + Send + Sync + 'a {}
impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {}
impl Sealed for dyn Error + '_ {}
impl Sealed for dyn Error + Send + '_ {}
impl Sealed for dyn Error + Send + Sync + '_ {}
impl Sealed for dyn Error + Send + Sync + UnwindSafe + '_ {}