Skip to content

Commit

Permalink
lib: allow renamed_and_removed_lints for now
Browse files Browse the repository at this point in the history
Nightly clippy renamed `thread_local_initializer_can_be_made_const` to
`missing_const_for_thread_local`.

We can't use the new name on stable; we must keep using the old name to
suppress the finding. If we don't allow `renamed_and_removed_lints`, we
can't use the old name on nightly; it generates a warning about the new
name... Using _both_ names won't work for the same reason, and our
setting to allow _unknown_ lints won't help.

There's no convenient way to change which name we use based on whether
we're building with nightly or not so, for now, let's just allow
`renamed_and_removed_lints` :-(
  • Loading branch information
cpu committed Jul 29, 2024
1 parent fe04153 commit c190a9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#![crate_type = "staticlib"]
#![allow(non_camel_case_types)]
// TODO(XXX): Remove `renamed_and_removed_lints` once stable renames `thread_local_initializer_can_be_made_const`
#![allow(renamed_and_removed_lints)]
#![allow(clippy::not_unsafe_ptr_arg_deref)]
// TODO(#333): Fix this clippy warning.
#![allow(clippy::arc_with_non_send_sync)]
Expand Down Expand Up @@ -54,7 +56,9 @@ include!(concat!(env!("OUT_DIR"), "/version.rs"));
// Rust code, we model these thread locals as a stack, so we can always
// restore the previous version.
thread_local! {
#[allow(clippy::thread_local_initializer_can_be_made_const)]
// TODO(XXX): Remove 'thread_local_initializer_can_be_made_const' in the future
// once stable has renamed.
#[allow(clippy::thread_local_initializer_can_be_made_const, clippy::missing_const_for_thread_local)]
pub(crate) static USERDATA: RefCell<Vec<Userdata>> = RefCell::new(Vec::new());
}

Expand Down

0 comments on commit c190a9a

Please sign in to comment.