From c272f64b60ed6f899aa2e73af8635ebbb5032102 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 11 May 2026 09:58:06 +0300 Subject: [PATCH 1/6] Add some rules --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 53886778bab..5ffda75f763 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -344,4 +344,6 @@ unnested_or_patterns = "warn" # pedantic lints to enforce gradually cloned_instead_of_copied = "warn" +collapsible_else_if = "warn" +comparison_chain = "warn" must_use_candidate = "warn" From 113fc7e3c74c23e8641aeb03f9ee41a4b4bc2aed Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 11 May 2026 10:13:54 +0300 Subject: [PATCH 2/6] Add `explicit_iter*` clippy rules --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 5ffda75f763..3439e27f548 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -346,4 +346,6 @@ unnested_or_patterns = "warn" cloned_instead_of_copied = "warn" collapsible_else_if = "warn" comparison_chain = "warn" +explicit_into_iter_loop = "warn" +explicit_iter_loop = "warn" must_use_candidate = "warn" From 749e815183e7d655006bbc83e8f8bc736c785a25 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 11 May 2026 10:14:19 +0300 Subject: [PATCH 3/6] Fix clippy rules --- crates/codegen/src/compile.rs | 6 +++--- crates/codegen/src/ir.rs | 6 +++--- crates/compiler-core/src/bytecode.rs | 2 +- crates/compiler-core/src/marshal.rs | 4 ++-- crates/stdlib/src/faulthandler.rs | 4 ++-- crates/stdlib/src/ssl/cert.rs | 4 ++-- crates/vm/src/builtins/namespace.rs | 2 +- crates/vm/src/builtins/template.rs | 2 +- crates/vm/src/builtins/type.rs | 4 ++-- crates/vm/src/class.rs | 2 +- crates/vm/src/exception_group.rs | 2 +- crates/vm/src/frame.rs | 2 +- crates/vm/src/gc_state.rs | 4 ++-- crates/vm/src/object/core.rs | 2 +- crates/vm/src/stdlib/_ctypes.rs | 2 +- crates/vm/src/stdlib/_ctypes/base.rs | 4 ++-- crates/vm/src/stdlib/_ctypes/structure.rs | 6 +++--- crates/vm/src/stdlib/_ctypes/union.rs | 6 +++--- crates/vm/src/stdlib/_io.rs | 4 ++-- crates/vm/src/stdlib/_typing.rs | 2 +- crates/vm/src/stdlib/atexit.rs | 2 +- crates/vm/src/stdlib/gc.rs | 2 +- crates/vm/src/stdlib/marshal.rs | 4 ++-- 23 files changed, 39 insertions(+), 39 deletions(-) diff --git a/crates/codegen/src/compile.rs b/crates/codegen/src/compile.rs index 3f53fe10e15..73873b4e302 100644 --- a/crates/codegen/src/compile.rs +++ b/crates/codegen/src/compile.rs @@ -823,7 +823,7 @@ impl Compiler { } } - for elt in elts.iter() { + for elt in elts { if let ast::Expr::Starred(ast::ExprStarred { value, .. }) = elt { // When we hit first star, build sequence with elements so far if !sequence_built { @@ -11514,7 +11514,7 @@ impl Compiler { let mut current_string = Wtf8Buf::new(); let mut interp_count: u32 = 0; - for tstring in tstring_value.iter() { + for tstring in tstring_value { self.collect_tstring_strings( tstring, &mut all_strings, @@ -11539,7 +11539,7 @@ impl Compiler { } ); - for tstring in tstring_value.iter() { + for tstring in tstring_value { self.compile_tstring_interpolations(tstring)?; } diff --git a/crates/codegen/src/ir.rs b/crates/codegen/src/ir.rs index 17764a99206..34d30514934 100644 --- a/crates/codegen/src/ir.rs +++ b/crates/codegen/src/ir.rs @@ -529,7 +529,7 @@ impl CodeInfo { // Final DCE: truncate instructions after terminal ops in linearized blocks. // This catches dead code created by normalize_jumps after the initial DCE. - for block in blocks.iter_mut() { + for block in &mut blocks { if let Some(pos) = block .instructions .iter() @@ -540,7 +540,7 @@ impl CodeInfo { } // Pre-compute cache_entries for real (non-pseudo) instructions - for block in blocks.iter_mut() { + for block in &mut blocks { for instr in &mut block.instructions { if let AnyInstruction::Real(op) = instr.instr { instr.cache_entries = op.cache_entries() as u32; @@ -9431,7 +9431,7 @@ impl CodeInfo { // Fix up handler stack_depth in ExceptHandlerInfo using start_depths // computed above: depth = start_depth - 1 - preserve_lasti - for block in self.blocks.iter_mut() { + for block in &mut self.blocks { for ins in &mut block.instructions { if let Some(ref mut handler) = ins.except_handler { let h_start = start_depths[handler.handler_block.idx()]; diff --git a/crates/compiler-core/src/bytecode.rs b/crates/compiler-core/src/bytecode.rs index 220de487880..eb33a526a14 100644 --- a/crates/compiler-core/src/bytecode.rs +++ b/crates/compiler-core/src/bytecode.rs @@ -652,7 +652,7 @@ impl CodeUnits { /// Disable adaptive specialization by setting all counters to unreachable. /// Used for CPython-compiled bytecode where specialization may not be safe. pub fn disable_specialization(&self) { - for counter in self.adaptive_counters.iter() { + for counter in &self.adaptive_counters { counter.store(UNREACHABLE_BACKOFF, Ordering::Relaxed); } } diff --git a/crates/compiler-core/src/marshal.rs b/crates/compiler-core/src/marshal.rs index c9115f25359..829c1dc9519 100644 --- a/crates/compiler-core/src/marshal.rs +++ b/crates/compiler-core/src/marshal.rs @@ -928,13 +928,13 @@ pub fn serialize_code(buf: &mut W, code: &CodeObject) let total_lp_count = code.varnames.len() + cell_only_names.len() + code.freevars.len(); buf.write_u8(Type::Tuple as u8); write_len(buf, total_lp_count); - for n in code.varnames.iter() { + for n in &code.varnames { write_marshal_str(buf, n.as_ref()); } for &n in &cell_only_names { write_marshal_str(buf, n); } - for n in code.freevars.iter() { + for n in &code.freevars { write_marshal_str(buf, n.as_ref()); } // 10: co_localspluskinds — use the stored kinds directly diff --git a/crates/stdlib/src/faulthandler.rs b/crates/stdlib/src/faulthandler.rs index 3c3533d9914..7309a9c647f 100644 --- a/crates/stdlib/src/faulthandler.rs +++ b/crates/stdlib/src/faulthandler.rs @@ -632,7 +632,7 @@ mod decl { } unsafe { - for handler in FAULTHANDLER_HANDLERS.iter_mut() { + for handler in &mut FAULTHANDLER_HANDLERS { if handler.enabled { continue; } @@ -700,7 +700,7 @@ mod decl { } unsafe { - for handler in FAULTHANDLER_HANDLERS.iter_mut() { + for handler in &mut FAULTHANDLER_HANDLERS { faulthandler_disable_fatal_handler(handler); } } diff --git a/crates/stdlib/src/ssl/cert.rs b/crates/stdlib/src/ssl/cert.rs index 002b77f1823..f42f5ebf189 100644 --- a/crates/stdlib/src/ssl/cert.rs +++ b/crates/stdlib/src/ssl/cert.rs @@ -473,7 +473,7 @@ pub(super) fn cert_der_to_dict_helper( if let Some(ext) = ext_map.get(&OID_X509_EXT_CRL_DISTRIBUTION_POINTS) && let ParsedExtension::CRLDistributionPoints(cdp) = &ext.parsed_extension() { - for dp in cdp.points.iter() { + for dp in &cdp.points { if let Some(dist_point) = &dp.distribution_point { use x509_parser::extensions::DistributionPointName; if let DistributionPointName::FullName(names) = dist_point { @@ -583,7 +583,7 @@ pub(super) fn build_verified_chain( let issuer_name = last_cert.issuer(); let mut found_issuer = false; - for ca_der in ca_certs_der.iter() { + for ca_der in ca_certs_der { let (_, ca_cert) = match X509Certificate::from_der(ca_der) { Ok(parsed) => parsed, Err(_) => continue, diff --git a/crates/vm/src/builtins/namespace.rs b/crates/vm/src/builtins/namespace.rs index 1ec73e0f732..1768cf7d985 100644 --- a/crates/vm/src/builtins/namespace.rs +++ b/crates/vm/src/builtins/namespace.rs @@ -99,7 +99,7 @@ impl Initializer for PyNamespace { }; // Validate keys are strings and set attributes - for (key, value) in dict.into_iter() { + for (key, value) in dict { let key_str = key .downcast_ref::() .ok_or_else(|| { diff --git a/crates/vm/src/builtins/template.rs b/crates/vm/src/builtins/template.rs index ba5e9c5eb0c..11fe99f3411 100644 --- a/crates/vm/src/builtins/template.rs +++ b/crates/vm/src/builtins/template.rs @@ -55,7 +55,7 @@ impl Constructor for PyTemplate { let mut interpolations: Vec = Vec::new(); let mut last_was_str = false; - for item in args.args.iter() { + for item in &args.args { if let Ok(s) = item.clone().downcast::() { if last_was_str { // Concatenate adjacent strings diff --git a/crates/vm/src/builtins/type.rs b/crates/vm/src/builtins/type.rs index 6208bc5ebfe..3b3e81e3c23 100644 --- a/crates/vm/src/builtins/type.rs +++ b/crates/vm/src/builtins/type.rs @@ -824,7 +824,7 @@ impl PyType { pub(crate) fn init_slots(&self, ctx: &Context) { // Inherit slots from MRO (mro[0] is self, so skip it) let mro: Vec<_> = self.mro.read()[1..].to_vec(); - for base in mro.iter() { + for base in &mro { self.inherit_slots(base); } @@ -833,7 +833,7 @@ impl PyType { let mut slot_name_set = std::collections::HashSet::new(); // mro[0] is self, so skip it; self.attributes is checked separately below - for cls in self.mro.read()[1..].iter() { + for cls in &self.mro.read()[1..] { for &name in cls.attributes.read().keys() { if name.as_bytes().starts_with(b"__") && name.as_bytes().ends_with(b"__") { slot_name_set.insert(name); diff --git a/crates/vm/src/class.rs b/crates/vm/src/class.rs index e0179f5451d..2e8af54f974 100644 --- a/crates/vm/src/class.rs +++ b/crates/vm/src/class.rs @@ -16,7 +16,7 @@ use rustpython_common::static_cell; /// 1. Has a function set in the type's slots /// 2. Doesn't already have an attribute in the type's dict pub fn add_operators(class: &'static Py, ctx: &Context) { - for def in SLOT_DEFS.iter() { + for def in SLOT_DEFS { // Skip __new__ - it has special handling if def.name == "__new__" { continue; diff --git a/crates/vm/src/exception_group.rs b/crates/vm/src/exception_group.rs index 22f299922f8..4698aa4874a 100644 --- a/crates/vm/src/exception_group.rs +++ b/crates/vm/src/exception_group.rs @@ -405,7 +405,7 @@ pub(super) mod types { // If it's a tuple of types if let Some(tuple) = condition.downcast_ref::() { let mut types = Vec::new(); - for item in tuple.iter() { + for item in tuple { let typ: PyTypeRef = item.clone().try_into_value(vm).map_err(|_| { vm.new_type_error( "expected a function, exception type or tuple of exception types", diff --git a/crates/vm/src/frame.rs b/crates/vm/src/frame.rs index c87341de32a..e80109fd549 100644 --- a/crates/vm/src/frame.rs +++ b/crates/vm/src/frame.rs @@ -978,7 +978,7 @@ impl Frame { // Non-merged cell: find the name by skipping merged cellvars let mut found_name = None; let mut skip = nonmerged_cell_idx; - for cv in code.cellvars.iter() { + for cv in &code.cellvars { let is_merged = code.varnames.contains(cv); if !is_merged { if skip == 0 { diff --git a/crates/vm/src/gc_state.rs b/crates/vm/src/gc_state.rs index 37252bc4a0b..d29b9bb6c99 100644 --- a/crates/vm/src/gc_state.rs +++ b/crates/vm/src/gc_state.rs @@ -699,7 +699,7 @@ impl GcState { if debug.contains(GcDebugFlags::SAVEALL) { let mut garbage_guard = self.garbage.lock(); - for obj_ref in truly_dead.iter() { + for obj_ref in &truly_dead { garbage_guard.push(obj_ref.clone()); } } @@ -708,7 +708,7 @@ impl GcState { // Break cycles by clearing references (tp_clear) // Use deferred drop context to prevent stack overflow. rustpython_common::refcount::with_deferred_drops(|| { - for obj_ref in truly_dead.iter() { + for obj_ref in &truly_dead { if obj_ref.gc_has_clear() { let edges = unsafe { obj_ref.gc_clear() }; drop(edges); diff --git a/crates/vm/src/object/core.rs b/crates/vm/src/object/core.rs index ec4c6327975..110325a9a9f 100644 --- a/crates/vm/src/object/core.rs +++ b/crates/vm/src/object/core.rs @@ -1828,7 +1828,7 @@ impl PyObject { if let Some(dict_ref) = ext.dict.as_ref().and_then(|d| d.replace(None)) { result.push(dict_ref.into()); } - for slot in ext.slots.iter() { + for slot in &ext.slots { if let Some(val) = slot.write().take() { result.push(val); } diff --git a/crates/vm/src/stdlib/_ctypes.rs b/crates/vm/src/stdlib/_ctypes.rs index 9ddc33762f7..f4799dd7957 100644 --- a/crates/vm/src/stdlib/_ctypes.rs +++ b/crates/vm/src/stdlib/_ctypes.rs @@ -882,7 +882,7 @@ pub(crate) mod _ctypes { && let Ok(fields) = fields_attr.try_to_value::>(vm) { let mut max_align = 1usize; - for field in fields.iter() { + for field in &fields { if let Some(tuple) = field.downcast_ref::() && let Some(field_type) = tuple.get(1) { diff --git a/crates/vm/src/stdlib/_ctypes/base.rs b/crates/vm/src/stdlib/_ctypes/base.rs index 7d611c27b0f..8c9138721b3 100644 --- a/crates/vm/src/stdlib/_ctypes/base.rs +++ b/crates/vm/src/stdlib/_ctypes/base.rs @@ -2528,7 +2528,7 @@ fn make_fields( return Err(vm.new_type_error("_fields_ must be a sequence")); }; - for pair in fieldlist.iter() { + for pair in &fieldlist { let field_tuple = pair .downcast_ref::() .ok_or_else(|| vm.new_type_error("_fields_ must contain tuples"))?; @@ -2587,7 +2587,7 @@ pub(super) fn make_anon_fields(cls: &Py, vm: &VirtualMachine) -> PyResul return Err(vm.new_type_error("_anonymous_ must be a sequence")); }; - for fname_obj in anon_names.iter() { + for fname_obj in &anon_names { let fname = fname_obj .downcast_ref::() .ok_or_else(|| vm.new_type_error("_anonymous_ items must be strings"))?; diff --git a/crates/vm/src/stdlib/_ctypes/structure.rs b/crates/vm/src/stdlib/_ctypes/structure.rs index a12edf52524..6651392432d 100644 --- a/crates/vm/src/stdlib/_ctypes/structure.rs +++ b/crates/vm/src/stdlib/_ctypes/structure.rs @@ -16,7 +16,7 @@ pub(super) fn calculate_struct_size(cls: &Py, vm: &VirtualMachine) -> Py let fields: Vec = fields_attr.try_to_value(vm)?; let mut total_size = 0usize; - for field in fields.iter() { + for field in &fields { if let Some(tuple) = field.downcast_ref::() && let Some(field_type) = tuple.get(1) { @@ -738,7 +738,7 @@ impl PyCStructure { if let Some(fields_attr) = type_obj.get_direct_attr(vm.ctx.intern_str("_fields_")) { let fields: Vec = fields_attr.try_to_value(vm)?; - for field in fields.iter() { + for field in &fields { if current_index >= args.len() { break; } @@ -786,7 +786,7 @@ impl Initializer for PyCStructure { } // 2. Process keyword arguments - for (key, value) in args.kwargs.iter() { + for (key, value) in &args.kwargs { zelf.as_object() .set_attr(vm.ctx.intern_str(key.as_str()), value.clone(), vm)?; } diff --git a/crates/vm/src/stdlib/_ctypes/union.rs b/crates/vm/src/stdlib/_ctypes/union.rs index 1eb8403f24f..a2845fc78c5 100644 --- a/crates/vm/src/stdlib/_ctypes/union.rs +++ b/crates/vm/src/stdlib/_ctypes/union.rs @@ -16,7 +16,7 @@ pub(super) fn calculate_union_size(cls: &Py, vm: &VirtualMachine) -> PyR let fields: Vec = fields_attr.try_to_value(vm)?; let mut max_size = 0usize; - for field in fields.iter() { + for field in &fields { if let Some(tuple) = field.downcast_ref::() && let Some(field_type) = tuple.get(1) { @@ -609,7 +609,7 @@ impl PyCUnion { if let Some(fields_attr) = type_obj.get_direct_attr(vm.ctx.intern_str("_fields_")) { let fields: Vec = fields_attr.try_to_value(vm)?; - for field in fields.iter() { + for field in &fields { if current_index >= args.len() { break; } @@ -656,7 +656,7 @@ impl Initializer for PyCUnion { } // 2. Process keyword arguments - for (key, value) in args.kwargs.iter() { + for (key, value) in &args.kwargs { zelf.as_object() .set_attr(vm.ctx.intern_str(key.as_str()), value.clone(), vm)?; } diff --git a/crates/vm/src/stdlib/_io.rs b/crates/vm/src/stdlib/_io.rs index 5295dba5012..04e48272c73 100644 --- a/crates/vm/src/stdlib/_io.rs +++ b/crates/vm/src/stdlib/_io.rs @@ -4532,7 +4532,7 @@ mod _io { let dict_ref: PyRef = dict.clone().try_into_value(vm)?; if let Some(obj_dict) = zelf.as_object().dict() { obj_dict.clear(); - for (key, value) in dict_ref.into_iter() { + for (key, value) in dict_ref { obj_dict.set_item(&*key, value, vm)?; } } @@ -4774,7 +4774,7 @@ mod _io { let dict_ref: PyRef = dict.clone().try_into_value(vm)?; if let Some(obj_dict) = zelf.as_object().dict() { obj_dict.clear(); - for (key, value) in dict_ref.into_iter() { + for (key, value) in dict_ref { obj_dict.set_item(&*key, value, vm)?; } } diff --git a/crates/vm/src/stdlib/_typing.rs b/crates/vm/src/stdlib/_typing.rs index 70554037d46..df22e58ddcb 100644 --- a/crates/vm/src/stdlib/_typing.rs +++ b/crates/vm/src/stdlib/_typing.rs @@ -164,7 +164,7 @@ pub(crate) mod decl { fn typing_type_repr_value(value: &PyObjectRef, vm: &VirtualMachine) -> PyResult { if let Ok(tuple) = value.try_to_ref::(vm) { let mut parts = Vec::with_capacity(tuple.len()); - for item in tuple.iter() { + for item in tuple { parts.push(typing_type_repr(item, vm)?); } let inner = if parts.len() == 1 { diff --git a/crates/vm/src/stdlib/atexit.rs b/crates/vm/src/stdlib/atexit.rs index 638927fe90f..891f8e5437b 100644 --- a/crates/vm/src/stdlib/atexit.rs +++ b/crates/vm/src/stdlib/atexit.rs @@ -69,7 +69,7 @@ mod atexit { pub fn _run_exitfuncs(vm: &VirtualMachine) { let funcs: Vec<_> = core::mem::take(&mut *vm.state.atexit_funcs.lock()); // Callbacks stored in LIFO order, iterate forward - for entry in funcs.into_iter() { + for entry in funcs { let (func, args) = *entry; if let Err(e) = func.call(args, vm) { let exit = e.fast_isinstance(vm.ctx.exceptions.system_exit); diff --git a/crates/vm/src/stdlib/gc.rs b/crates/vm/src/stdlib/gc.rs index 3909186b5c0..9c568c67a62 100644 --- a/crates/vm/src/stdlib/gc.rs +++ b/crates/vm/src/stdlib/gc.rs @@ -133,7 +133,7 @@ mod gc { let stats = gc_state::gc_state().get_stats(); let mut result = Vec::with_capacity(3); - for stat in stats.iter() { + for stat in &stats { let dict = vm.ctx.new_dict(); dict.set_item("collections", vm.ctx.new_int(stat.collections).into(), vm)?; dict.set_item("collected", vm.ctx.new_int(stat.collected).into(), vm)?; diff --git a/crates/vm/src/stdlib/marshal.rs b/crates/vm/src/stdlib/marshal.rs index b19cc5eb52e..60ecb1792f0 100644 --- a/crates/vm/src/stdlib/marshal.rs +++ b/crates/vm/src/stdlib/marshal.rs @@ -293,7 +293,7 @@ mod decl { } } else if let Some(d) = obj.downcast_ref::() { buf.write_u8(b'{'); - for (k, v) in d.into_iter() { + for (k, v) in d { write_object_depth(buf, &k, refs, version, vm, depth - 1)?; write_object_depth(buf, &v, refs, version, vm, depth - 1)?; } @@ -572,7 +572,7 @@ mod decl { check_no_code(&elem, vm)?; } } else if let Some(dict) = obj.downcast_ref::() { - for (k, v) in dict.into_iter() { + for (k, v) in dict { check_no_code(&k, vm)?; check_no_code(&v, vm)?; } From 317ea17a3a0e8d5e52ff59c094d4f8fc6f28555a Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 11 May 2026 10:21:31 +0300 Subject: [PATCH 4/6] Add more clippy rules --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 3439e27f548..3d0c292fc63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -348,4 +348,7 @@ collapsible_else_if = "warn" comparison_chain = "warn" explicit_into_iter_loop = "warn" explicit_iter_loop = "warn" +filter_map_next = "warn" +flat_map_option = "warn" +inconsistent_struct_constructor = "warn" must_use_candidate = "warn" From 2cd6b763ab2c0905fc04a1aeb7c2bfc29fac5daf Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 11 May 2026 10:33:05 +0300 Subject: [PATCH 5/6] Fix windows clippy --- crates/vm/src/stdlib/nt.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/vm/src/stdlib/nt.rs b/crates/vm/src/stdlib/nt.rs index 554012987aa..1dfc5f9c062 100644 --- a/crates/vm/src/stdlib/nt.rs +++ b/crates/vm/src/stdlib/nt.rs @@ -1074,7 +1074,7 @@ pub(crate) mod module { // Build environment strings as "KEY=VALUE\0" wide strings let mut env_strings: Vec = Vec::new(); - for (key, value) in env.into_iter() { + for (key, value) in env { let key = FsPath::try_from_path_like(key, true, vm)?; let value = FsPath::try_from_path_like(value, true, vm)?; let key_str = key.to_string_lossy(); @@ -1192,7 +1192,7 @@ pub(crate) mod module { let env = crate::stdlib::os::envobj_to_dict(env, vm)?; // Build environment strings as "KEY=VALUE\0" wide strings let mut env_strings: Vec = Vec::new(); - for (key, value) in env.into_iter() { + for (key, value) in env { let key = PyStrRef::try_from_object(vm, key)?; let value = PyStrRef::try_from_object(vm, value)?; let key_str = key.expect_str(); From 0d5bf96cc89ad32a5ec0c4de89234e6e783097e6 Mon Sep 17 00:00:00 2001 From: ShaharNaveh <50263213+ShaharNaveh@users.noreply.github.com> Date: Mon, 11 May 2026 10:50:23 +0300 Subject: [PATCH 6/6] clippy windows --- crates/stdlib/src/faulthandler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/stdlib/src/faulthandler.rs b/crates/stdlib/src/faulthandler.rs index 7309a9c647f..1664ae4e1ba 100644 --- a/crates/stdlib/src/faulthandler.rs +++ b/crates/stdlib/src/faulthandler.rs @@ -609,7 +609,7 @@ mod decl { // Disable SIGSEGV handler for access violations to avoid double output if code == 0xC0000005 { unsafe { - for handler in FAULTHANDLER_HANDLERS.iter_mut() { + for handler in &mut FAULTHANDLER_HANDLERS { if handler.signum == libc::SIGSEGV { faulthandler_disable_fatal_handler(handler); break; @@ -661,7 +661,7 @@ mod decl { } unsafe { - for handler in FAULTHANDLER_HANDLERS.iter_mut() { + for handler in &mut FAULTHANDLER_HANDLERS { if handler.enabled { continue; }