diff --git a/crates/oxc_traverse/scripts/lib/ancestor.mjs b/crates/oxc_traverse/scripts/lib/ancestor.mjs index c1716cbd09fdf..25189899d31d2 100644 --- a/crates/oxc_traverse/scripts/lib/ancestor.mjs +++ b/crates/oxc_traverse/scripts/lib/ancestor.mjs @@ -112,9 +112,7 @@ export default function generateAncestorsCode(types) { } return ` - #![allow( - unsafe_code, - clippy::missing_safety_doc, + #![expect( clippy::ptr_as_ptr, clippy::undocumented_unsafe_blocks, clippy::cast_ptr_alignment, @@ -131,7 +129,6 @@ export default function generateAncestorsCode(types) { /// Used in [\`crate::TraverseCtx::retag_stack\`]. #[repr(u16)] #[derive(Clone, Copy)] - #[allow(dead_code)] pub(crate) enum AncestorType { None = 0, ${ancestorTypeEnumVariants} diff --git a/crates/oxc_traverse/scripts/lib/traverse.mjs b/crates/oxc_traverse/scripts/lib/traverse.mjs index f13e1481a292b..58a74e05f1aa5 100644 --- a/crates/oxc_traverse/scripts/lib/traverse.mjs +++ b/crates/oxc_traverse/scripts/lib/traverse.mjs @@ -24,7 +24,7 @@ export default function generateTraverseTraitCode(types) { use crate::TraverseCtx; - #[allow(unused_variables)] + #[expect(unused_variables)] pub trait Traverse<'a> { ${traverseMethods} } diff --git a/crates/oxc_traverse/scripts/lib/walk.mjs b/crates/oxc_traverse/scripts/lib/walk.mjs index 2aa1faa203a06..5e13df7a908be 100644 --- a/crates/oxc_traverse/scripts/lib/walk.mjs +++ b/crates/oxc_traverse/scripts/lib/walk.mjs @@ -22,15 +22,10 @@ export default function generateWalkFunctionsCode(types) { } return ` - #![allow( - unsafe_code, - clippy::missing_safety_doc, - clippy::missing_panics_doc, - clippy::undocumented_unsafe_blocks, + #![expect( clippy::semicolon_if_nothing_returned, clippy::ptr_as_ptr, clippy::ref_as_ptr, - clippy::borrow_as_ptr, clippy::cast_ptr_alignment )] diff --git a/crates/oxc_traverse/src/context/ancestry.rs b/crates/oxc_traverse/src/context/ancestry.rs index 0056896cd9348..dcf483c133652 100644 --- a/crates/oxc_traverse/src/context/ancestry.rs +++ b/crates/oxc_traverse/src/context/ancestry.rs @@ -160,7 +160,7 @@ impl<'a> TraverseAncestry<'a> { /// # SAFETY /// This method must not be public outside this crate, or consumer could break safety invariants. #[inline] - #[allow(unused_variables, clippy::needless_pass_by_value)] + #[expect(unused_variables, clippy::needless_pass_by_value)] pub(crate) fn pop_stack(&mut self, token: PopToken) { // SAFETY: `PopToken`s are only created in `push_stack`, so the fact that caller provides one // guarantees that a push has happened. This method consumes the token which guarantees another @@ -191,7 +191,7 @@ impl<'a> TraverseAncestry<'a> { /// /// This method must not be public outside this crate, or consumer could break safety invariants. #[inline] - #[allow(unsafe_code, clippy::ptr_as_ptr, clippy::ref_as_ptr)] + #[expect(clippy::ptr_as_ptr, clippy::ref_as_ptr)] pub(crate) unsafe fn retag_stack(&mut self, ty: AncestorType) { debug_assert!(self.stack.len() >= 2); *(self.stack.last_mut() as *mut _ as *mut AncestorType) = ty; diff --git a/crates/oxc_traverse/src/context/scoping.rs b/crates/oxc_traverse/src/context/scoping.rs index d86e139c0c704..a11a7a8e6e9c2 100644 --- a/crates/oxc_traverse/src/context/scoping.rs +++ b/crates/oxc_traverse/src/context/scoping.rs @@ -286,7 +286,7 @@ impl TraverseScoping { /// what was found in AST. /// i.e. if source contains identifiers `_foo` and `__bar`, create UIDs names `___0`, `___1`, /// `___2` etc. They'll all be unique within the program. - #[allow(clippy::missing_panics_doc)] + #[expect(clippy::missing_panics_doc)] pub fn generate_uid_name(&mut self, name: &str) -> CompactStr { // If `uid_names` is not already populated, initialize it if self.uid_names.is_none() { diff --git a/crates/oxc_traverse/src/generated/ancestor.rs b/crates/oxc_traverse/src/generated/ancestor.rs index 46a49d12c0e4b..cf41ec67e7d42 100644 --- a/crates/oxc_traverse/src/generated/ancestor.rs +++ b/crates/oxc_traverse/src/generated/ancestor.rs @@ -2,9 +2,7 @@ // Generated by `oxc_traverse/scripts/build.mjs`. // To alter this generated file you have to edit the codegen. -#![allow( - unsafe_code, - clippy::missing_safety_doc, +#![expect( clippy::ptr_as_ptr, clippy::undocumented_unsafe_blocks, clippy::cast_ptr_alignment, @@ -21,7 +19,6 @@ use oxc_syntax::scope::ScopeId; /// Used in [`crate::TraverseCtx::retag_stack`]. #[repr(u16)] #[derive(Clone, Copy)] -#[allow(dead_code)] pub(crate) enum AncestorType { None = 0, ProgramHashbang = 1, diff --git a/crates/oxc_traverse/src/generated/traverse.rs b/crates/oxc_traverse/src/generated/traverse.rs index fe19d7f0b5543..7c09f1e2d9823 100644 --- a/crates/oxc_traverse/src/generated/traverse.rs +++ b/crates/oxc_traverse/src/generated/traverse.rs @@ -7,7 +7,7 @@ use oxc_ast::ast::*; use crate::TraverseCtx; -#[allow(unused_variables)] +#[expect(unused_variables)] pub trait Traverse<'a> { #[inline] fn enter_program(&mut self, node: &mut Program<'a>, ctx: &mut TraverseCtx<'a>) {} diff --git a/crates/oxc_traverse/src/generated/walk.rs b/crates/oxc_traverse/src/generated/walk.rs index 99736dba0727c..6258c52c6d23e 100644 --- a/crates/oxc_traverse/src/generated/walk.rs +++ b/crates/oxc_traverse/src/generated/walk.rs @@ -2,15 +2,10 @@ // Generated by `oxc_traverse/scripts/build.mjs`. // To alter this generated file you have to edit the codegen. -#![allow( - unsafe_code, - clippy::missing_safety_doc, - clippy::missing_panics_doc, - clippy::undocumented_unsafe_blocks, +#![expect( clippy::semicolon_if_nothing_returned, clippy::ptr_as_ptr, clippy::ref_as_ptr, - clippy::borrow_as_ptr, clippy::cast_ptr_alignment )]