From 93cd5ef8463903ba8fcb7b6cc04bdf588bc18102 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 16 Nov 2023 11:58:58 -0600 Subject: [PATCH 1/2] chore(ci): Catch naive use of AtomicU64 early AtomicU64 is not portable and use of it, without `target_has_atomic`, will fail CI for rust-lang/rust when the cargo submodule gets updated (see #12981). If there is a reason to use it, we could always `allow` in that one case. --- clippy.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clippy.toml b/clippy.toml index f50e3658819..6ba9dc13b8d 100644 --- a/clippy.toml +++ b/clippy.toml @@ -6,3 +6,6 @@ disallowed-methods = [ { path = "std::env::vars", reason = "not recommended to use in Cargo. See rust-lang/cargo#11588" }, { path = "std::env::vars_os", reason = "not recommended to use in Cargo. See rust-lang/cargo#11588" }, ] +disallowed-types = [ + "std::sync::atomic::AtomicU64", +] From 8080b870bd6f47e9de61713ac02bd8c14c24cf8e Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 16 Nov 2023 12:34:02 -0600 Subject: [PATCH 2/2] chore: Communicate motivation for AtomucU64 Co-authored-by: Weihang Lo --- clippy.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy.toml b/clippy.toml index 6ba9dc13b8d..dff120e9511 100644 --- a/clippy.toml +++ b/clippy.toml @@ -7,5 +7,5 @@ disallowed-methods = [ { path = "std::env::vars_os", reason = "not recommended to use in Cargo. See rust-lang/cargo#11588" }, ] disallowed-types = [ - "std::sync::atomic::AtomicU64", + { path = "std::sync::atomic::AtomicU64", reason = "not portable. See rust-lang/cargo#12988" }, ]