diff --git a/crates/oxc_prettier/src/doc.rs b/crates/oxc_prettier/src/doc.rs index 91d717668e88a..417d7a3e78fc9 100644 --- a/crates/oxc_prettier/src/doc.rs +++ b/crates/oxc_prettier/src/doc.rs @@ -166,8 +166,8 @@ pub struct IfBreak<'a> { } #[derive(Clone, Copy)] -#[allow(unused)] pub enum Separator { + #[allow(unused)] Softline, Hardline, CommaLine, // [",", line] @@ -196,7 +196,6 @@ pub trait DocBuilder<'a> { Box::new_in(doc, self.allocator()) } - #[allow(unused)] fn join(&self, separator: Separator, docs: std::vec::Vec>) -> Vec<'a, Doc<'a>> { let mut parts = self.vec(); for (i, doc) in docs.into_iter().enumerate() { diff --git a/crates/oxc_prettier/src/format/misc.rs b/crates/oxc_prettier/src/format/misc.rs index 4ff2402ca3b04..de96a26322802 100644 --- a/crates/oxc_prettier/src/format/misc.rs +++ b/crates/oxc_prettier/src/format/misc.rs @@ -1,7 +1,7 @@ use oxc_ast::{ast::*, AstKind}; use oxc_span::Span; -use crate::{array, doc::Doc, indent, line, space, ss, Prettier}; +use crate::{array, doc::Doc, indent, line, space, ss, DocBuilder, Prettier}; pub(super) fn adjust_clause<'a>( p: &Prettier<'a>, diff --git a/crates/oxc_prettier/src/format/ternary.rs b/crates/oxc_prettier/src/format/ternary.rs index c7b5d9a541098..7efd76b9571a3 100644 --- a/crates/oxc_prettier/src/format/ternary.rs +++ b/crates/oxc_prettier/src/format/ternary.rs @@ -1,6 +1,6 @@ use oxc_ast::ast::*; -use crate::{doc::Doc, group, indent, line, ss, Format, Prettier}; +use crate::{doc::Doc, group, indent, line, ss, DocBuilder, Format, Prettier}; pub(super) fn print_ternary<'a>(p: &mut Prettier<'a>, expr: &ConditionalExpression<'a>) -> Doc<'a> { group![ diff --git a/crates/oxc_prettier/src/lib.rs b/crates/oxc_prettier/src/lib.rs index 01bb3b407c485..601ade5ba9bca 100644 --- a/crates/oxc_prettier/src/lib.rs +++ b/crates/oxc_prettier/src/lib.rs @@ -145,7 +145,6 @@ impl<'a> Prettier<'a> { self.should_print_comma_impl(false) } - #[allow(unused)] fn should_print_all_comma(&self) -> bool { self.should_print_comma_impl(true) } diff --git a/crates/oxc_prettier/src/macros.rs b/crates/oxc_prettier/src/macros.rs index dfe6761a38ab2..088eaed5347d7 100644 --- a/crates/oxc_prettier/src/macros.rs +++ b/crates/oxc_prettier/src/macros.rs @@ -33,7 +33,6 @@ macro_rules! string { macro_rules! indent { ($p:ident, $( $x:expr ),* $(,)?) => { { - use $crate::doc::DocBuilder; let mut temp_vec = $p.vec(); $( temp_vec.push($x); @@ -81,7 +80,6 @@ macro_rules! hardline { macro_rules! array { ($p:ident, $( $x:expr ),* $(,)?) => { { - use $crate::doc::DocBuilder; let mut temp_vec = $p.vec(); $( temp_vec.push($x); @@ -95,7 +93,6 @@ macro_rules! array { macro_rules! group { ($p:ident, $( $x:expr ),* $(,)?) => { { - use $crate::doc::DocBuilder; let mut temp_vec = $p.vec(); $( temp_vec.push($x); @@ -109,7 +106,6 @@ macro_rules! group { macro_rules! conditional_group { ($p:ident, $c: expr, $( $x:expr ),* $(,)?) => { { - use $crate::doc::DocBuilder; let mut temp_vec = $p.vec(); $( temp_vec.push($x); @@ -124,7 +120,6 @@ macro_rules! conditional_group { macro_rules! group_break { ($p:ident, $( $x:expr ),* $(,)?) => { { - use $crate::doc::DocBuilder; let mut temp_vec = $p.vec(); $( temp_vec.push($x); @@ -137,7 +132,7 @@ macro_rules! group_break { #[macro_export] macro_rules! if_break { ($p:ident, $s:expr, $flat:expr, $group_id:expr) => {{ - use $crate::doc::{DocBuilder, IfBreak}; + use $crate::doc::IfBreak; Doc::IfBreak(IfBreak { break_contents: $p.boxed(Doc::Str($s)), flat_content: $p.boxed(Doc::Str($flat)), @@ -156,7 +151,6 @@ macro_rules! if_break { macro_rules! line_suffix { ($p:ident, $( $x:expr ),* $(,)?) => { { - use $crate::doc::DocBuilder; let mut temp_vec = $p.vec(); $( temp_vec.push($x); diff --git a/crates/oxc_prettier/src/needs_parens.rs b/crates/oxc_prettier/src/needs_parens.rs index 054b0139997ab..1698ec3b42759 100644 --- a/crates/oxc_prettier/src/needs_parens.rs +++ b/crates/oxc_prettier/src/needs_parens.rs @@ -22,7 +22,7 @@ use oxc_syntax::{ precedence::GetPrecedence, }; -use crate::{array, binaryish::BinaryishOperator, doc::Doc, ss, Prettier}; +use crate::{array, binaryish::BinaryishOperator, doc::Doc, ss, DocBuilder, Prettier}; impl<'a> Prettier<'a> { pub(crate) fn wrap_parens(&mut self, doc: Doc<'a>, kind: AstKind<'a>) -> Doc<'a> { diff --git a/crates/oxc_semantic/src/counter.rs b/crates/oxc_semantic/src/counter.rs index 52c2bb688c98c..e7994a08c2517 100644 --- a/crates/oxc_semantic/src/counter.rs +++ b/crates/oxc_semantic/src/counter.rs @@ -30,6 +30,7 @@ impl Counts { counts } + #[cfg(debug_assertions)] pub fn assert_accurate(actual: &Self, estimated: &Self) { assert_eq!(actual.nodes, estimated.nodes, "nodes count mismatch"); assert_eq!(actual.scopes, estimated.scopes, "scopes count mismatch"); diff --git a/crates/oxc_semantic/tests/integration/util/expect.rs b/crates/oxc_semantic/tests/integration/util/expect.rs index f5f16294cd4f2..6c40d81badb72 100644 --- a/crates/oxc_semantic/tests/integration/util/expect.rs +++ b/crates/oxc_semantic/tests/integration/util/expect.rs @@ -1,5 +1,4 @@ pub trait Expect { - #[allow(unused)] #[must_use] fn expect(self, expectation: F) -> Self where diff --git a/crates/oxc_transformer/src/env/targets/query.rs b/crates/oxc_transformer/src/env/targets/query.rs index d1ecef5fc79b3..e87b46e148a68 100644 --- a/crates/oxc_transformer/src/env/targets/query.rs +++ b/crates/oxc_transformer/src/env/targets/query.rs @@ -16,7 +16,6 @@ use super::{version::Version, Versions}; #[allow(clippy::large_enum_variant)] pub enum Targets { Query(Query), - #[allow(unused)] EsModules(EsModules), Versions(Versions), HashMap(FxHashMap), diff --git a/crates/oxc_transformer/src/helpers/bindings.rs b/crates/oxc_transformer/src/helpers/bindings.rs index eeb5c2ee9afa0..f7e9190a22695 100644 --- a/crates/oxc_transformer/src/helpers/bindings.rs +++ b/crates/oxc_transformer/src/helpers/bindings.rs @@ -106,7 +106,6 @@ impl<'a> BoundIdentifier<'a> { } /// Create `IdentifierReference` referencing this binding, which is written to, with specified `Span` - #[allow(unused)] pub fn create_spanned_write_reference( &self, span: Span, @@ -127,7 +126,6 @@ impl<'a> BoundIdentifier<'a> { /// Create `IdentifierReference` referencing this binding, which is read from + written to, /// with specified `Span` - #[allow(unused)] pub fn create_spanned_read_write_reference( &self, span: Span, diff --git a/crates/oxc_transformer/src/typescript/mod.rs b/crates/oxc_transformer/src/typescript/mod.rs index dab29e7e619a0..243d9b2837552 100644 --- a/crates/oxc_transformer/src/typescript/mod.rs +++ b/crates/oxc_transformer/src/typescript/mod.rs @@ -40,7 +40,6 @@ use crate::context::Ctx; /// /// In: `const x: number = 0;` /// Out: `const x = 0;` -#[allow(unused)] pub struct TypeScript<'a> { options: Rc, ctx: Ctx<'a>,