@@ -39,7 +39,7 @@ declare_clippy_lint! {
39
39
/// }
40
40
/// ```
41
41
#[ clippy:: version = "1.77.0" ]
42
- pub THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST ,
42
+ pub MISSING_CONST_FOR_TL_INIT ,
43
43
perf,
44
44
"suggest using `const` in `thread_local!` macro"
45
45
}
@@ -55,7 +55,7 @@ impl ThreadLocalInitializerCanBeMadeConst {
55
55
}
56
56
}
57
57
58
- impl_lint_pass ! ( ThreadLocalInitializerCanBeMadeConst => [ THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST ] ) ;
58
+ impl_lint_pass ! ( ThreadLocalInitializerCanBeMadeConst => [ MISSING_CONST_FOR_TL_INIT ] ) ;
59
59
60
60
#[ inline]
61
61
fn is_thread_local_initializer (
@@ -113,7 +113,7 @@ impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst {
113
113
local_defid : rustc_span:: def_id:: LocalDefId ,
114
114
) {
115
115
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:: MISSING_CONST_FOR_TL_INIT )
117
117
&& is_thread_local_initializer ( cx, fn_kind, span) . unwrap_or ( false )
118
118
// Some implementations of `thread_local!` include an initializer fn.
119
119
// In the case of a const initializer, the init fn is also const,
@@ -139,7 +139,7 @@ impl<'tcx> LateLintPass<'tcx> for ThreadLocalInitializerCanBeMadeConst {
139
139
{
140
140
span_lint_and_sugg (
141
141
cx,
142
- THREAD_LOCAL_INITIALIZER_CAN_BE_MADE_CONST ,
142
+ MISSING_CONST_FOR_TL_INIT ,
143
143
unpeeled. span ,
144
144
"initializer for `thread_local` value can be made `const`" ,
145
145
"replace with" ,
0 commit comments