Skip to content

Commit 6a90b1f

Browse files
authored
fix(swc_common): Fix build with swc_allocator/nightly (#10067)
**Description:** It was not shown because the feature was not enabled by default.
1 parent 853eb53 commit 6a90b1f

File tree

3 files changed

+60
-61
lines changed

3 files changed

+60
-61
lines changed

Diff for: crates/swc_common/src/eq.rs

+35-36
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::{cell::RefCell, rc::Rc, sync::Arc};
22

33
use num_bigint::BigInt;
4-
use swc_allocator::nightly_only;
54

65
use crate::{BytePos, Span};
76

@@ -64,20 +63,20 @@ where
6463
}
6564
}
6665

67-
nightly_only!(
68-
impl<T> EqIgnoreSpan for swc_allocator::vec::Vec<T>
69-
where
70-
T: EqIgnoreSpan,
71-
{
72-
fn eq_ignore_span(&self, other: &Self) -> bool {
73-
self.len() == other.len()
74-
&& self
75-
.iter()
76-
.zip(other.iter())
77-
.all(|(a, b)| a.eq_ignore_span(b))
78-
}
79-
}
80-
);
66+
// nightly_only!(
67+
// impl<T> EqIgnoreSpan for swc_allocator::vec::Vec<T>
68+
// where
69+
// T: EqIgnoreSpan,
70+
// {
71+
// fn eq_ignore_span(&self, other: &Self) -> bool {
72+
// self.len() == other.len()
73+
// && self
74+
// .iter()
75+
// .zip(other.iter())
76+
// .all(|(a, b)| a.eq_ignore_span(b))
77+
// }
78+
// }
79+
// );
8180

8281
/// Derive with `#[derive(TypeEq)]`.
8382
pub trait TypeEq {
@@ -188,27 +187,27 @@ macro_rules! deref {
188187

189188
deref!(Box, Rc, Arc);
190189

191-
swc_allocator::nightly_only!(
192-
impl<N> EqIgnoreSpan for swc_allocator::boxed::Box<N>
193-
where
194-
N: EqIgnoreSpan,
195-
{
196-
#[inline]
197-
fn eq_ignore_span(&self, other: &Self) -> bool {
198-
(**self).eq_ignore_span(&**other)
199-
}
200-
}
201-
202-
impl<N> TypeEq for swc_allocator::boxed::Box<N>
203-
where
204-
N: TypeEq,
205-
{
206-
#[inline]
207-
fn type_eq(&self, other: &Self) -> bool {
208-
(**self).type_eq(&**other)
209-
}
210-
}
211-
);
190+
// swc_allocator::nightly_only!(
191+
// impl<N> EqIgnoreSpan for swc_allocator::boxed::Box<N>
192+
// where
193+
// N: EqIgnoreSpan,
194+
// {
195+
// #[inline]
196+
// fn eq_ignore_span(&self, other: &Self) -> bool {
197+
// (**self).eq_ignore_span(&**other)
198+
// }
199+
// }
200+
201+
// impl<N> TypeEq for swc_allocator::boxed::Box<N>
202+
// where
203+
// N: TypeEq,
204+
// {
205+
// #[inline]
206+
// fn type_eq(&self, other: &Self) -> bool {
207+
// (**self).type_eq(&**other)
208+
// }
209+
// }
210+
// );
212211

213212
impl<N> EqIgnoreSpan for &N
214213
where

Diff for: crates/swc_common/src/pos.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,13 @@ where
191191
}
192192
}
193193

194-
swc_allocator::nightly_only!(
195-
impl<T> Spanned for swc_allocator::boxed::Box<T>
196-
where
197-
T: Spanned,
198-
{
199-
fn span(&self) -> Span {
200-
self.as_ref().span()
201-
}
202-
}
203-
);
194+
// swc_allocator::nightly_only!(
195+
// impl<T> Spanned for swc_allocator::boxed::Box<T>
196+
// where
197+
// T: Spanned,
198+
// {
199+
// fn span(&self) -> Span {
200+
// self.as_ref().span()
201+
// }
202+
// }
203+
// );

Diff for: crates/swc_common/src/util/take.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,19 @@ impl Take for Span {
5555
}
5656
}
5757

58-
swc_allocator::nightly_only!(
59-
impl<T> Take for swc_allocator::boxed::Box<T>
60-
where
61-
T: Take,
62-
{
63-
fn dummy() -> Self {
64-
swc_allocator::boxed::Box::new(T::dummy())
65-
}
66-
}
58+
// swc_allocator::nightly_only!(
59+
// impl<T> Take for swc_allocator::boxed::Box<T>
60+
// where
61+
// T: Take,
62+
// {
63+
// fn dummy() -> Self {
64+
// swc_allocator::boxed::Box::new(T::dummy())
65+
// }
66+
// }
6767

68-
impl<T> Take for swc_allocator::vec::Vec<T> {
69-
fn dummy() -> Self {
70-
Default::default()
71-
}
72-
}
73-
);
68+
// impl<T> Take for swc_allocator::vec::Vec<T> {
69+
// fn dummy() -> Self {
70+
// Default::default()
71+
// }
72+
// }
73+
// );

0 commit comments

Comments
 (0)