summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel McCarney <daniel@binaryparadox.net>2024-07-19 17:09:52 -0400
committerDaniel McCarney <daniel@binaryparadox.net>2024-07-29 09:32:44 -0400
commitc190a9a9d2926737f86846f94cb8cab8a787a3ae (patch)
tree2bdc5ecba9bd51758bc48b3f25a0eeb3f100795d
parentfe0415310112c441c2673cc4a6eb7243c456af12 (diff)
lib: allow renamed_and_removed_lints for now
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` :-(
-rw-r--r--src/lib.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b18d6e8..c95ea53 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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)]
@@ -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());
}