Skip to content

Commit 0f065a3

Browse files
committed
Fix remaining clippy warnings
- Explicitly disable derive_partialord and derive_ord in bindgen - Fix uninlined format args in nvvm crate - Keep specific no_partialeq/no_hash for types with function pointers
1 parent 91de22e commit 0f065a3

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

crates/cust_raw/build/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ fn create_cuda_driver_bindings(
150150
.derive_default(true)
151151
.derive_eq(true)
152152
.derive_hash(true)
153+
.derive_partialord(false)
154+
.derive_ord(false)
153155
.size_t_is_usize(true)
154156
.layout_tests(true)
155157
.must_use_type("CUresult")
@@ -197,6 +199,8 @@ fn create_cuda_runtime_bindings(
197199
.derive_default(true)
198200
.derive_eq(true)
199201
.derive_hash(true)
202+
.derive_partialord(false)
203+
.derive_ord(false)
200204
.size_t_is_usize(true)
201205
.layout_tests(true)
202206
.must_use_type("cudaError_t")
@@ -248,7 +252,7 @@ fn create_cublas_bindings(sdk: &cuda_sdk::CudaSdk, outdir: &path::Path, manifest
248252
.derive_default(true)
249253
.derive_eq(true)
250254
.derive_hash(true)
251-
.size_t_is_usize(true)
255+
.size_t_is_usize(true)
252256
.layout_tests(true)
253257
.must_use_type("cublasStatus_t")
254258
.generate()
@@ -287,6 +291,8 @@ fn create_nptx_compiler_bindings(
287291
.derive_default(true)
288292
.derive_eq(true)
289293
.derive_hash(true)
294+
.derive_partialord(false)
295+
.derive_ord(false)
290296
.size_t_is_usize(true)
291297
.layout_tests(true)
292298
.must_use_type("nvPTXCompileResult")
@@ -319,6 +325,8 @@ fn create_nvvm_bindings(sdk: &cuda_sdk::CudaSdk, outdir: &path::Path, manifest_d
319325
.derive_default(true)
320326
.derive_eq(true)
321327
.derive_hash(true)
328+
.derive_partialord(false)
329+
.derive_ord(false)
322330
.size_t_is_usize(true)
323331
.layout_tests(true)
324332
.must_use_type("nvvmResult")

crates/nvvm/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl Display for NvvmOption {
166166
Self::GenDebugInfo => "-g",
167167
Self::GenLineInfo => "-generate-line-info",
168168
Self::NoOpts => "-opt=0",
169-
Self::Arch(arch) => return f.write_str(&format!("-arch={}", arch)),
169+
Self::Arch(arch) => return f.write_str(&format!("-arch={arch}")),
170170
Self::Ftz => "-ftz=1",
171171
Self::FastSqrt => "-prec-sqrt=0",
172172
Self::FastDiv => "-prec-div=0",
@@ -283,7 +283,7 @@ pub enum NvvmArch {
283283

284284
impl Display for NvvmArch {
285285
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
286-
let mut raw = format!("{:?}", self).to_ascii_lowercase();
286+
let mut raw = format!("{self:?}").to_ascii_lowercase();
287287
raw.insert(7, '_');
288288
f.write_str(&raw)
289289
}
@@ -327,7 +327,7 @@ impl NvvmProgram {
327327
unsafe {
328328
let options = options
329329
.iter()
330-
.map(|x| format!("{}\0", x))
330+
.map(|x| format!("{x}\0"))
331331
.collect::<Vec<_>>();
332332
let mut options_ptr = options
333333
.iter()

0 commit comments

Comments
 (0)