diff --git a/src/jsc/bindings/NodeFSStatBinding.cpp b/src/jsc/bindings/NodeFSStatBinding.cpp index 6e69feb21c77..09df724b13d0 100644 --- a/src/jsc/bindings/NodeFSStatBinding.cpp +++ b/src/jsc/bindings/NodeFSStatBinding.cpp @@ -934,11 +934,6 @@ JSC_DEFINE_HOST_FUNCTION(callBigIntStats, (JSC::JSGlobalObject * lexicalGlobalOb return JSValue::encode(callJSStatsFunction(lexicalGlobalObject, callFrame)); } -extern "C" JSC::EncodedJSValue Bun__JSBigIntStatsObjectConstructor(Zig::GlobalObject* globalobject) -{ - return JSValue::encode(globalobject->m_JSStatsBigIntClassStructure.constructor(globalobject)); -} - extern "C" JSC::EncodedJSValue Bun__JSStatsObjectConstructor(Zig::GlobalObject* globalobject) { return JSValue::encode(globalobject->m_JSStatsClassStructure.constructor(globalobject)); diff --git a/src/lint/ast/name.rs b/src/lint/ast/name.rs index 4807d7a18811..107714a87f37 100644 --- a/src/lint/ast/name.rs +++ b/src/lint/ast/name.rs @@ -104,12 +104,6 @@ impl std::hash::Hash for Name<'_> { self.atom.0.hash(state); } } -impl PartialEq for Name<'_> { - #[inline] - fn eq(&self, other: &str) -> bool { - self.has(other.as_bytes()) - } -} impl PartialEq<&str> for Name<'_> { #[inline] fn eq(&self, other: &&str) -> bool { diff --git a/src/lint/code_path/mod.rs b/src/lint/code_path/mod.rs index 9d63f0a3ab5b..c84578632dac 100644 --- a/src/lint/code_path/mod.rs +++ b/src/lint/code_path/mod.rs @@ -286,12 +286,6 @@ impl PartialEq for CodePath<'_> { } } impl Eq for CodePath<'_> {} -impl std::hash::Hash for CodePath<'_> { - #[inline] - fn hash(&self, state: &mut H) { - self.id.hash(state); - } -} /// ESLint's `codePath.id`: `s1` impl std::fmt::Display for CodePath<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { @@ -512,12 +506,6 @@ impl crate::types::Indexed for Segment<'_> { self.id } } -impl std::hash::Hash for Segment<'_> { - #[inline] - fn hash(&self, state: &mut H) { - self.id.hash(state); - } -} /// ESLint's `segment.id`: `s1_2` impl std::fmt::Display for Segment<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { diff --git a/src/lint/estree/value.rs b/src/lint/estree/value.rs index 65cfdc4bd31b..2c2bc1c6336c 100644 --- a/src/lint/estree/value.rs +++ b/src/lint/estree/value.rs @@ -55,12 +55,6 @@ impl<'a> Emit<'a> for bool { sink.bool(self); } } -impl<'a> Emit<'a> for f64 { - #[inline] - fn emit(self, sink: &mut impl Sink<'a>) { - sink.number(self); - } -} impl<'a> Emit<'a> for &'a [u8] { #[inline] fn emit(self, sink: &mut impl Sink<'a>) { @@ -128,12 +122,6 @@ impl From for Value<'_> { Value::Bool(value) } } -impl From for Value<'_> { - #[inline] - fn from(value: f64) -> Self { - Value::Number(value) - } -} impl<'a> From<&'a [u8]> for Value<'a> { #[inline] fn from(value: &'a [u8]) -> Self { diff --git a/src/lint/selector/mod.rs b/src/lint/selector/mod.rs index 91e7c95eff6a..e449f63f1273 100644 --- a/src/lint/selector/mod.rs +++ b/src/lint/selector/mod.rs @@ -112,12 +112,6 @@ impl PartialEq for EsNode<'_> { } } impl Eq for EsNode<'_> {} -impl std::hash::Hash for EsNode<'_> { - #[inline] - fn hash(&self, state: &mut H) { - self.node.hash(state); - } -} impl<'a> EsNode<'a> { /// `node_type` must be `node`'s type. diff --git a/src/lint/semantic/mod.rs b/src/lint/semantic/mod.rs index c0e2cbe40e6b..8bb9ee29bcda 100644 --- a/src/lint/semantic/mod.rs +++ b/src/lint/semantic/mod.rs @@ -553,13 +553,6 @@ bitflags::bitflags! { } } -impl From for DeclarationKinds { - #[inline] - fn from(kind: DeclarationKind) -> DeclarationKinds { - DeclarationKinds::from_bits_retain(1 << kind as u16) - } -} - impl<'a> Declaration<'a> { #[inline] fn new(file: &'a File<'a>, decl: Decl) -> Self { @@ -724,12 +717,6 @@ impl PartialEq for Reference<'_> { } } impl Eq for Reference<'_> {} -impl std::hash::Hash for Reference<'_> { - #[inline] - fn hash(&self, state: &mut H) { - std::ptr::from_ref(self.raw).addr().hash(state); - } -} impl std::fmt::Debug for Reference<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( diff --git a/src/lint/types/signature.rs b/src/lint/types/signature.rs index b59b9802c2c1..02978a1bf688 100644 --- a/src/lint/types/signature.rs +++ b/src/lint/types/signature.rs @@ -27,12 +27,6 @@ impl crate::types::Indexed for Signature<'_> { self.id.0 } } -impl std::hash::Hash for Signature<'_> { - #[inline] - fn hash(&self, state: &mut H) { - self.id.hash(state); - } -} impl std::fmt::Debug for Signature<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "Signature({})", bstr::BStr::new(&self.to_text())) diff --git a/src/lint/types/symbol.rs b/src/lint/types/symbol.rs index f630328d494a..9b12b8914792 100644 --- a/src/lint/types/symbol.rs +++ b/src/lint/types/symbol.rs @@ -27,12 +27,6 @@ impl crate::types::Indexed for TsSymbol<'_> { self.id.0 } } -impl std::hash::Hash for TsSymbol<'_> { - #[inline] - fn hash(&self, state: &mut H) { - self.id.hash(state); - } -} impl std::fmt::Debug for TsSymbol<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "TsSymbol({})", bstr::BStr::new(self.name())) diff --git a/src/lint/types/ty.rs b/src/lint/types/ty.rs index e1cefad2051a..b9b598da1613 100644 --- a/src/lint/types/ty.rs +++ b/src/lint/types/ty.rs @@ -156,13 +156,6 @@ impl<'a> Iterator for TypeIter<'a> { (len, Some(len)) } } -impl DoubleEndedIterator for TypeIter<'_> { - #[inline] - fn next_back(&mut self) -> Option { - let id = self.ids.next_back().copied().or_else(|| self.one.take())?; - Some(Type::new(self.file, id)) - } -} impl ExactSizeIterator for TypeIter<'_> {} /// `ts.TupleType`: `reference.target` of a tuple type. diff --git a/src/lint/utils/ast_utils.rs b/src/lint/utils/ast_utils.rs index 5a49fb4f87d0..94de34ea5168 100644 --- a/src/lint/utils/ast_utils.rs +++ b/src/lint/utils/ast_utils.rs @@ -379,12 +379,6 @@ impl<'t, 'a: 't> From> for TokenOrText<'t> { TokenOrText::Token(token.kind(), token.text()) } } -impl<'t, 'a: 't> From<&Token<'a>> for TokenOrText<'t> { - #[inline] - fn from(token: &Token<'a>) -> Self { - TokenOrText::Token(token.kind(), token.text()) - } -} impl<'t> From<&'t str> for TokenOrText<'t> { #[inline] fn from(text: &'t str) -> Self { diff --git a/src/lint/utils/estree_compat.rs b/src/lint/utils/estree_compat.rs index 54bcf7a1257e..52cb316164b6 100644 --- a/src/lint/utils/estree_compat.rs +++ b/src/lint/utils/estree_compat.rs @@ -196,30 +196,6 @@ pub struct TargetElement<'a> { pub node: Node<'a>, } -impl<'a> From> for Target<'a> { - #[inline] - fn from(pat: Pat<'a>) -> Self { - Target::Pat(pat) - } -} - -impl<'a> From> for Target<'a> { - #[inline] - fn from(e: Expr<'a>) -> Self { - Target::Expr(e) - } -} - -impl<'a> From> for Node<'a> { - #[inline] - fn from(target: Target<'a>) -> Self { - match target { - Target::Pat(pat) => Node::Pat(pat), - Target::Expr(e) => Node::Expr(e), - } - } -} - impl Spanned for Target<'_> { #[inline] fn span(&self) -> Span { diff --git a/src/react_compiler/hir/id_map.rs b/src/react_compiler/hir/id_map.rs index 69395d36d59b..323ca80cc592 100644 --- a/src/react_compiler/hir/id_map.rs +++ b/src/react_compiler/hir/id_map.rs @@ -342,22 +342,6 @@ impl fmt::Debug for IdMap< } } -impl, V, A: MapAllocator> Extend<(K, V)> for IdMap { - fn extend>(&mut self, iter: I) { - for (k, v) in iter { - self.insert(k, v); - } - } -} - -impl, V, A: MapAllocator> FromIterator<(K, V)> for IdMap { - fn from_iter>(iter: I) -> Self { - let mut map = Self::new(); - map.extend(iter); - map - } -} - impl IntoIterator for IdMap { type Item = (K, V); type IntoIter = core::iter::Zip, std::vec::IntoIter>; @@ -490,16 +474,6 @@ impl Default for IdBitSet { } } -impl Clone for IdBitSet { - fn clone(&self) -> Self { - Self { - words: self.words.clone(), - len: self.len, - key: PhantomData, - } - } -} - impl PartialEq for IdBitSet { fn eq(&self, other: &Self) -> bool { let shared = self.words.len().min(other.words.len()); diff --git a/src/runtime/node/Stat.rs b/src/runtime/node/Stat.rs index 6b8cc3b8b375..165bde76f1e1 100644 --- a/src/runtime/node/Stat.rs +++ b/src/runtime/node/Stat.rs @@ -53,14 +53,6 @@ impl StatType { Self::stat_to_js(&self.value, global) } - pub(crate) fn get_constructor(global: &JSGlobalObject) -> JSValue { - if BIG { - Bun__JSBigIntStatsObjectConstructor(global) - } else { - Bun__JSStatsObjectConstructor(global) - } - } - fn stat_to_js(stat_: &PosixStat, global: &JSGlobalObject) -> JsResult { let a_time = stat_.atime(); let m_time = stat_.mtime(); @@ -124,7 +116,6 @@ impl StatType { } unsafe extern "C" { - safe fn Bun__JSBigIntStatsObjectConstructor(global: &JSGlobalObject) -> JSValue; safe fn Bun__JSStatsObjectConstructor(global: &JSGlobalObject) -> JSValue; safe fn Bun__createJSStatsObject( @@ -171,6 +162,12 @@ unsafe extern "C" { pub(crate) type StatsSmall = StatType; pub(crate) type StatsBig = StatType; +impl StatsSmall { + pub(crate) fn get_constructor(global: &JSGlobalObject) -> JSValue { + Bun__JSStatsObjectConstructor(global) + } +} + /// Test-only: build a Stats/BigIntStats from a raw u64 ino via the real /// statToJS path, so regression tests can exercise high-inode values without /// a filesystem that hands them out.