From e29a25cb3104e74cc1665dbf2c89e6a38fd12cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Tue, 4 May 2021 14:42:57 +0900 Subject: [PATCH] Workaround https://github.com/rust-lang/rust/issues/64402 --- node/babel/ast/src/lib.rs | 3 +++ node/babel/compat/Cargo.toml | 6 ------ node/babel/compat/benches/babelify.rs | 8 -------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/node/babel/ast/src/lib.rs b/node/babel/ast/src/lib.rs index 46210ba0fe9a..3b1f807bbe37 100644 --- a/node/babel/ast/src/lib.rs +++ b/node/babel/ast/src/lib.rs @@ -1,5 +1,8 @@ #![feature(macro_attributes_in_derive_output)] +/// Explicit extern crate to use global allocator. +extern crate swc_node_base; + mod class; mod comment; mod common; diff --git a/node/babel/compat/Cargo.toml b/node/babel/compat/Cargo.toml index cf8f1fa931d4..10e4ecaa4aba 100644 --- a/node/babel/compat/Cargo.toml +++ b/node/babel/compat/Cargo.toml @@ -29,9 +29,3 @@ swc_node_base = {path = "../../base"} pretty_assertions = "0.7.1" swc_ecma_transforms = {path = "../../../ecmascript/transforms/"} walkdir = "2" - -[target.'cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64")))'.dev-dependencies] -jemallocator = {version = "0.3", features = ["disable_initial_exec_tls"]} - -[target.'cfg(windows)'.dev-dependencies] -mimalloc = {version = "0.1"} diff --git a/node/babel/compat/benches/babelify.rs b/node/babel/compat/benches/babelify.rs index 968ae6b07ee3..cc44f29c5698 100644 --- a/node/babel/compat/benches/babelify.rs +++ b/node/babel/compat/benches/babelify.rs @@ -17,14 +17,6 @@ use swc_ecma_transforms::typescript; use swc_ecma_visit::FoldWith; use test::Bencher; -#[cfg(all(unix, not(target_env = "musl"), not(target_arch = "aarch64")))] -#[global_allocator] -static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc; - -#[cfg(windows)] -#[global_allocator] -static ALLOC: mimalloc::MiMalloc = mimalloc::MiMalloc; - static SOURCE: &str = include_str!("assets/AjaxObservable.ts"); fn mk() -> swc::Compiler {