Skip to content

Commit

Permalink
Merge pull request #413 from dtolnay/elidablelifetime
Browse files Browse the repository at this point in the history
Clippy elidable_lifetime_names lint
  • Loading branch information
dtolnay authored Mar 3, 2025
2 parents 5f07160 + 9f27b76 commit 76490f7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
14 changes: 12 additions & 2 deletions impl/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ fn impl_struct(input: Struct) -> TokenStream {
}
};
Some(quote! {
#[allow(deprecated, unused_qualifications, clippy::needless_lifetimes)]
#[allow(
deprecated,
unused_qualifications,
clippy::elidable_lifetime_names,
clippy::needless_lifetimes,
)]
#from_impl
})
});
Expand Down Expand Up @@ -451,7 +456,12 @@ fn impl_enum(input: Enum) -> TokenStream {
}
};
Some(quote! {
#[allow(deprecated, unused_qualifications, clippy::needless_lifetimes)]
#[allow(
deprecated,
unused_qualifications,
clippy::elidable_lifetime_names,
clippy::needless_lifetimes,
)]
#from_impl
})
});
Expand Down
8 changes: 4 additions & 4 deletions src/aserror.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '_ {}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
#![no_std]
#![doc(html_root_url = "https://docs.rs/thiserror/2.0.11")]
#![allow(
clippy::elidable_lifetime_names,
clippy::module_name_repetitions,
clippy::needless_lifetimes,
clippy::return_self_not_must_use,
Expand Down
1 change: 1 addition & 0 deletions tests/test_display.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![allow(
clippy::elidable_lifetime_names,
clippy::needless_lifetimes,
clippy::needless_raw_string_hashes,
clippy::trivially_copy_pass_by_ref,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn test_unused_qualifications() {
#[test]
fn test_needless_lifetimes() {
#![allow(dead_code)]
#![deny(clippy::needless_lifetimes)]
#![deny(clippy::elidable_lifetime_names, clippy::needless_lifetimes)]

#[derive(Error, Debug)]
#[error("...")]
Expand Down

0 comments on commit 76490f7

Please sign in to comment.