Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/jsc/bindings/NodeFSStatBinding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -934,11 +934,6 @@ JSC_DEFINE_HOST_FUNCTION(callBigIntStats, (JSC::JSGlobalObject * lexicalGlobalOb
return JSValue::encode(callJSStatsFunction<true>(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));
Expand Down
6 changes: 0 additions & 6 deletions src/lint/ast/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,6 @@ impl std::hash::Hash for Name<'_> {
self.atom.0.hash(state);
}
}
impl PartialEq<str> 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 {
Expand Down
12 changes: 0 additions & 12 deletions src/lint/code_path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,6 @@ impl PartialEq for CodePath<'_> {
}
}
impl Eq for CodePath<'_> {}
impl std::hash::Hash for CodePath<'_> {
#[inline]
fn hash<H: std::hash::Hasher>(&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 {
Expand Down Expand Up @@ -512,12 +506,6 @@ impl crate::types::Indexed for Segment<'_> {
self.id
}
}
impl std::hash::Hash for Segment<'_> {
#[inline]
fn hash<H: std::hash::Hasher>(&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 {
Expand Down
12 changes: 0 additions & 12 deletions src/lint/estree/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>) {
Expand Down Expand Up @@ -128,12 +122,6 @@ impl From<bool> for Value<'_> {
Value::Bool(value)
}
}
impl From<f64> 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 {
Expand Down
6 changes: 0 additions & 6 deletions src/lint/selector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ impl PartialEq for EsNode<'_> {
}
}
impl Eq for EsNode<'_> {}
impl std::hash::Hash for EsNode<'_> {
#[inline]
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.node.hash(state);
}
}

impl<'a> EsNode<'a> {
/// `node_type` must be `node`'s type.
Expand Down
13 changes: 0 additions & 13 deletions src/lint/semantic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,13 +553,6 @@ bitflags::bitflags! {
}
}

impl From<DeclarationKind> 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 {
Expand Down Expand Up @@ -724,12 +717,6 @@ impl PartialEq for Reference<'_> {
}
}
impl Eq for Reference<'_> {}
impl std::hash::Hash for Reference<'_> {
#[inline]
fn hash<H: std::hash::Hasher>(&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!(
Expand Down
6 changes: 0 additions & 6 deletions src/lint/types/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ impl crate::types::Indexed for Signature<'_> {
self.id.0
}
}
impl std::hash::Hash for Signature<'_> {
#[inline]
fn hash<H: std::hash::Hasher>(&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()))
Expand Down
6 changes: 0 additions & 6 deletions src/lint/types/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ impl crate::types::Indexed for TsSymbol<'_> {
self.id.0
}
}
impl std::hash::Hash for TsSymbol<'_> {
#[inline]
fn hash<H: std::hash::Hasher>(&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()))
Expand Down
7 changes: 0 additions & 7 deletions src/lint/types/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,6 @@ impl<'a> Iterator for TypeIter<'a> {
(len, Some(len))
}
}
impl DoubleEndedIterator for TypeIter<'_> {
#[inline]
fn next_back(&mut self) -> Option<Self::Item> {
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.
Expand Down
6 changes: 0 additions & 6 deletions src/lint/utils/ast_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,12 +379,6 @@ impl<'t, 'a: 't> From<Token<'a>> 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 {
Expand Down
24 changes: 0 additions & 24 deletions src/lint/utils/estree_compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,6 @@ pub struct TargetElement<'a> {
pub node: Node<'a>,
}

impl<'a> From<Pat<'a>> for Target<'a> {
#[inline]
fn from(pat: Pat<'a>) -> Self {
Target::Pat(pat)
}
}

impl<'a> From<Expr<'a>> for Target<'a> {
#[inline]
fn from(e: Expr<'a>) -> Self {
Target::Expr(e)
}
}

impl<'a> From<Target<'a>> 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 {
Expand Down
26 changes: 0 additions & 26 deletions src/react_compiler/hir/id_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,22 +342,6 @@ impl<K: Copy + fmt::Debug, V: fmt::Debug, A: MapAllocator> fmt::Debug for IdMap<
}
}

impl<K: Copy + Into<u32>, V, A: MapAllocator> Extend<(K, V)> for IdMap<K, V, A> {
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I) {
for (k, v) in iter {
self.insert(k, v);
}
}
}

impl<K: Copy + Into<u32>, V, A: MapAllocator> FromIterator<(K, V)> for IdMap<K, V, A> {
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self {
let mut map = Self::new();
map.extend(iter);
map
}
}

impl<K, V, A: MapAllocator> IntoIterator for IdMap<K, V, A> {
type Item = (K, V);
type IntoIter = core::iter::Zip<std::vec::IntoIter<K, A>, std::vec::IntoIter<V, A>>;
Expand Down Expand Up @@ -490,16 +474,6 @@ impl<K> Default for IdBitSet<K> {
}
}

impl<K> Clone for IdBitSet<K> {
fn clone(&self) -> Self {
Self {
words: self.words.clone(),
len: self.len,
key: PhantomData,
}
}
}

impl<K> PartialEq for IdBitSet<K> {
fn eq(&self, other: &Self) -> bool {
let shared = self.words.len().min(other.words.len());
Expand Down
15 changes: 6 additions & 9 deletions src/runtime/node/Stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ impl<const BIG: bool> StatType<BIG> {
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<JSValue> {
let a_time = stat_.atime();
let m_time = stat_.mtime();
Expand Down Expand Up @@ -124,7 +116,6 @@ impl<const BIG: bool> StatType<BIG> {
}

unsafe extern "C" {
safe fn Bun__JSBigIntStatsObjectConstructor(global: &JSGlobalObject) -> JSValue;
safe fn Bun__JSStatsObjectConstructor(global: &JSGlobalObject) -> JSValue;

safe fn Bun__createJSStatsObject(
Expand Down Expand Up @@ -171,6 +162,12 @@ unsafe extern "C" {
pub(crate) type StatsSmall = StatType<false>;
pub(crate) type StatsBig = StatType<true>;

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.
Expand Down
Loading