@@ -39,23 +39,23 @@ declare_clippy_lint! {
3939 /// }
4040 /// ```
4141 #[ clippy:: version = "1.77.0" ]
42- pub THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST ,
42+ pub MISSING_CONST_FOR_THREAD_LOCAL ,
4343 perf,
4444 "suggest using `const` in `thread_local!` macro"
4545}
4646
47- pub struct ThreadLocalInitializerCanBeMadeConst {
47+ pub struct MissingConstForThreadLocal {
4848 msrv : Msrv ,
4949}
5050
51- impl ThreadLocalInitializerCanBeMadeConst {
51+ impl MissingConstForThreadLocal {
5252 #[ must_use]
5353 pub fn new ( msrv : Msrv ) -> Self {
5454 Self { msrv }
5555 }
5656}
5757
58- impl_lint_pass ! ( ThreadLocalInitializerCanBeMadeConst => [ THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST ] ) ;
58+ impl_lint_pass ! ( MissingConstForThreadLocal => [ MISSING_CONST_FOR_THREAD_LOCAL ] ) ;
5959
6060#[ inline]
6161fn is_thread_local_initializer (
@@ -102,7 +102,7 @@ fn initializer_can_be_made_const(cx: &LateContext<'_>, defid: rustc_span::def_id
102102 false
103103}
104104
105- impl < ' tcx > LateLintPass < ' tcx > for ThreadLocalInitializerCanBeMadeConst {
105+ impl < ' tcx > LateLintPass < ' tcx > for MissingConstForThreadLocal {
106106 fn check_fn (
107107 & mut self ,
108108 cx : & LateContext < ' tcx > ,
@@ -113,7 +113,7 @@ impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst {
113113 local_defid : rustc_span:: def_id:: LocalDefId ,
114114 ) {
115115 let defid = local_defid. to_def_id ( ) ;
116- if self . msrv . meets ( msrvs:: THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST )
116+ if self . msrv . meets ( msrvs:: THREAD_LOCAL_CONST_INIT )
117117 && is_thread_local_initializer ( cx, fn_kind, span) . unwrap_or ( false )
118118 // Some implementations of `thread_local!` include an initializer fn.
119119 // In the case of a const initializer, the init fn is also const,
@@ -139,7 +139,7 @@ impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst {
139139 {
140140 span_lint_and_sugg (
141141 cx,
142- THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST ,
142+ MISSING_CONST_FOR_THREAD_LOCAL ,
143143 unpeeled. span ,
144144 "initializer for `thread_local` value can be made `const`" ,
145145 "replace with" ,
0 commit comments