@@ -79,6 +79,7 @@ declare_lint_pass! {
79
79
PROC_MACRO_BACK_COMPAT ,
80
80
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK ,
81
81
PUB_USE_OF_PRIVATE_EXTERN_CRATE ,
82
+ REDUNDANT_LIFETIMES ,
82
83
REFINING_IMPL_TRAIT_INTERNAL ,
83
84
REFINING_IMPL_TRAIT_REACHABLE ,
84
85
RENAMED_AND_REMOVED_LINTS ,
@@ -1694,6 +1695,27 @@ declare_lint! {
1694
1695
/// #[deny(unused_lifetimes)]
1695
1696
///
1696
1697
/// 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 never
1713
+ /// used, or are redundant because they are equal to another named lifetime.
1714
+ ///
1715
+ /// ### Example
1716
+ ///
1717
+ /// ```rust,compile_fail
1718
+ /// #[deny(redundant_lifetimes)]
1697
1719
///
1698
1720
/// // `'a = 'static`, so all usages of `'a` can be replaced with `'static`
1699
1721
/// pub fn bar<'a: 'static>() {}
@@ -1708,9 +1730,9 @@ declare_lint! {
1708
1730
///
1709
1731
/// Unused lifetime parameters may signal a mistake or unfinished code.
1710
1732
/// Consider removing the parameter.
1711
- pub UNUSED_LIFETIMES ,
1733
+ pub REDUNDANT_LIFETIMES ,
1712
1734
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 "
1714
1736
}
1715
1737
1716
1738
declare_lint ! {
0 commit comments