@@ -79,6 +79,7 @@ declare_lint_pass! {
7979 PROC_MACRO_BACK_COMPAT ,
8080 PROC_MACRO_DERIVE_RESOLUTION_FALLBACK ,
8181 PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
82+ REDUNDANT_LIFETIMES ,
8283 REFINING_IMPL_TRAIT_INTERNAL ,
8384 REFINING_IMPL_TRAIT_REACHABLE ,
8485 RENAMED_AND_REMOVED_LINTS ,
@@ -1694,6 +1695,27 @@ declare_lint! {
16941695 /// #[deny(unused_lifetimes)]
16951696 ///
16961697 /// pub fn foo<'a>() {}
1698+ /// ```
1699+ ///
1700+ /// {{produces}}
1701+ ///
1702+ /// ### Explanation
1703+ ///
1704+ /// Unused lifetime parameters may signal a mistake or unfinished code.
1705+ /// Consider removing the parameter.
1706+ pub UNUSED_LIFETIMES ,
1707+ Allow ,
1708+ "detects lifetime parameters that are never used"
1709+ }
1710+
1711+ declare_lint ! {
1712+ /// The `redundant_lifetimes` lint detects lifetime parameters that are
1713+ /// redundant because they are equal to another named lifetime.
1714+ ///
1715+ /// ### Example
1716+ ///
1717+ /// ```rust,compile_fail
1718+ /// #[deny(redundant_lifetimes)]
16971719 ///
16981720 /// // `'a = 'static`, so all usages of `'a` can be replaced with `'static`
16991721 /// pub fn bar<'a: 'static>() {}
@@ -1708,9 +1730,9 @@ declare_lint! {
17081730 ///
17091731 /// Unused lifetime parameters may signal a mistake or unfinished code.
17101732 /// Consider removing the parameter.
1711- pub UNUSED_LIFETIMES ,
1733+ pub REDUNDANT_LIFETIMES ,
17121734 Allow ,
1713- "detects lifetime parameters that are never used "
1735+ "detects lifetime parameters that are redundant because they are equal to some other named lifetime "
17141736}
17151737
17161738declare_lint ! {
0 commit comments