mirror of
https://github.com/dtolnay/thiserror.git
synced 2025-04-04 21:37:57 +03:00
Merge pull request #413 from dtolnay/elidablelifetime
Clippy elidable_lifetime_names lint
This commit is contained in:
commit
76490f743e
5 changed files with 19 additions and 7 deletions
|
@ -181,7 +181,12 @@ fn impl_struct(input: Struct) -> TokenStream {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Some(quote! {
|
Some(quote! {
|
||||||
#[allow(deprecated, unused_qualifications, clippy::needless_lifetimes)]
|
#[allow(
|
||||||
|
deprecated,
|
||||||
|
unused_qualifications,
|
||||||
|
clippy::elidable_lifetime_names,
|
||||||
|
clippy::needless_lifetimes,
|
||||||
|
)]
|
||||||
#from_impl
|
#from_impl
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -451,7 +456,12 @@ fn impl_enum(input: Enum) -> TokenStream {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Some(quote! {
|
Some(quote! {
|
||||||
#[allow(deprecated, unused_qualifications, clippy::needless_lifetimes)]
|
#[allow(
|
||||||
|
deprecated,
|
||||||
|
unused_qualifications,
|
||||||
|
clippy::elidable_lifetime_names,
|
||||||
|
clippy::needless_lifetimes,
|
||||||
|
)]
|
||||||
#from_impl
|
#from_impl
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -44,7 +44,7 @@ impl<'a> AsDynError<'a> for dyn Error + Send + Sync + UnwindSafe + 'a {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub trait Sealed {}
|
pub trait Sealed {}
|
||||||
impl<T: Error> Sealed for T {}
|
impl<T: Error> Sealed for T {}
|
||||||
impl<'a> Sealed for dyn Error + 'a {}
|
impl Sealed for dyn Error + '_ {}
|
||||||
impl<'a> Sealed for dyn Error + Send + 'a {}
|
impl Sealed for dyn Error + Send + '_ {}
|
||||||
impl<'a> Sealed for dyn Error + Send + Sync + 'a {}
|
impl Sealed for dyn Error + Send + Sync + '_ {}
|
||||||
impl<'a> Sealed for dyn Error + Send + Sync + UnwindSafe + 'a {}
|
impl Sealed for dyn Error + Send + Sync + UnwindSafe + '_ {}
|
||||||
|
|
|
@ -259,6 +259,7 @@
|
||||||
#![no_std]
|
#![no_std]
|
||||||
#![doc(html_root_url = "https://docs.rs/thiserror/2.0.11")]
|
#![doc(html_root_url = "https://docs.rs/thiserror/2.0.11")]
|
||||||
#![allow(
|
#![allow(
|
||||||
|
clippy::elidable_lifetime_names,
|
||||||
clippy::module_name_repetitions,
|
clippy::module_name_repetitions,
|
||||||
clippy::needless_lifetimes,
|
clippy::needless_lifetimes,
|
||||||
clippy::return_self_not_must_use,
|
clippy::return_self_not_must_use,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#![allow(
|
#![allow(
|
||||||
|
clippy::elidable_lifetime_names,
|
||||||
clippy::needless_lifetimes,
|
clippy::needless_lifetimes,
|
||||||
clippy::needless_raw_string_hashes,
|
clippy::needless_raw_string_hashes,
|
||||||
clippy::trivially_copy_pass_by_ref,
|
clippy::trivially_copy_pass_by_ref,
|
||||||
|
|
|
@ -33,7 +33,7 @@ fn test_unused_qualifications() {
|
||||||
#[test]
|
#[test]
|
||||||
fn test_needless_lifetimes() {
|
fn test_needless_lifetimes() {
|
||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
#![deny(clippy::needless_lifetimes)]
|
#![deny(clippy::elidable_lifetime_names, clippy::needless_lifetimes)]
|
||||||
|
|
||||||
#[derive(Error, Debug)]
|
#[derive(Error, Debug)]
|
||||||
#[error("...")]
|
#[error("...")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue