From 5c5e01029e4eb5d9e81d43627b51e3be37cba9b7 Mon Sep 17 00:00:00 2001 From: overlookmotel <557937+overlookmotel@users.noreply.github.com> Date: Thu, 13 Mar 2025 02:44:06 +0000 Subject: [PATCH] refactor(allocator/vec): disable lint warnings in `vec2` files (#9730) Disable lint warnings for `vec2::Vec` (the implementation copied from `bumpalo` in #9646). --- crates/oxc_allocator/src/vec2/mod.rs | 18 ++++++++++++++++++ crates/oxc_allocator/src/vec2/raw_vec.rs | 10 ++++++++++ 2 files changed, 28 insertions(+) diff --git a/crates/oxc_allocator/src/vec2/mod.rs b/crates/oxc_allocator/src/vec2/mod.rs index cf9ef3a9fcc1d..a9c2d6b762d74 100644 --- a/crates/oxc_allocator/src/vec2/mod.rs +++ b/crates/oxc_allocator/src/vec2/mod.rs @@ -90,6 +90,24 @@ //! [`IndexMut`]: https://doc.rust-lang.org/std/ops/trait.IndexMut.html //! [`vec!`]: ../../macro.vec.html +#![expect( + clippy::semicolon_if_nothing_returned, + clippy::needless_pass_by_ref_mut, + clippy::needless_for_each, + clippy::needless_lifetimes, + clippy::cloned_instead_of_copied, + clippy::checked_conversions, + clippy::legacy_numeric_constants, + clippy::cast_sign_loss, + clippy::cast_possible_wrap, + clippy::swap_ptr_to_ref, + clippy::ref_as_ptr, + clippy::ptr_as_ptr, + clippy::ptr_cast_constness, + unsafe_op_in_unsafe_fn, + clippy::undocumented_unsafe_blocks +)] + use super::raw_vec::RawVec; use crate::Bump; use crate::collections::CollectionAllocErr; diff --git a/crates/oxc_allocator/src/vec2/raw_vec.rs b/crates/oxc_allocator/src/vec2/raw_vec.rs index 08c9070627f5e..45d17ef5d1911 100644 --- a/crates/oxc_allocator/src/vec2/raw_vec.rs +++ b/crates/oxc_allocator/src/vec2/raw_vec.rs @@ -10,6 +10,16 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![allow( + unused_mut, + unused_unsafe, + clippy::allow_attributes, + clippy::uninlined_format_args, + clippy::enum_glob_use, + clippy::equatable_if_let, + clippy::needless_pass_by_value, + clippy::inline_always +)] #![allow(unstable_name_collisions)] #![allow(dead_code)]