build: Update rustc to nightly-2024-07-21 (#9319)

This commit is contained in:
Donny/강동윤 2024-07-23 14:31:35 +09:00 committed by GitHub
parent c49ad11e65
commit 279ea910e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
38 changed files with 302 additions and 290 deletions

View File

@ -0,0 +1,30 @@
---
binding_macros: patch
dbg-swc: patch
swc: patch
swc_bundler: patch
swc_common: patch
swc_core: patch
swc_css_codegen: patch
swc_css_compat: patch
swc_css_minifier: patch
swc_ecma_ast: patch
swc_ecma_codegen: patch
swc_ecma_codegen_macros: patch
swc_ecma_lints: patch
swc_ecma_minifier: patch
swc_ecma_transforms_base: patch
swc_ecma_transforms_module: patch
swc_ecma_transforms_testing: patch
swc_ecma_transforms_typescript: patch
swc_ecma_usage_analyzer: patch
swc_fast_graph: patch
swc_html_codegen: patch
swc_html_minifier: patch
swc_html_parser: patch
swc_macros_common: patch
swc_visit: patch
testing: patch
---
build: Update `rustc` to `nightly-2024-07-21`

245
Cargo.lock generated
View File

@ -40,9 +40,9 @@ dependencies = [
[[package]]
name = "ahash"
version = "0.8.8"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff"
checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
dependencies = [
"cfg-if",
"const-random",
@ -154,9 +154,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e"
[[package]]
name = "anyhow"
version = "1.0.81"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247"
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "arbitrary"
@ -181,9 +181,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]]
name = "assert_cmd"
version = "2.0.13"
version = "2.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00ad3f3a942eee60335ab4342358c161ee296829e0d16ff42fc1d6cb07815467"
checksum = "ed72493ac66d5804837f480ab3766c72bdfab91a65e565fc54fa9e42db0073a8"
dependencies = [
"anstyle",
"bstr",
@ -384,7 +384,7 @@ version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdf0ca73de70c3da94e4194e4a01fe732378f55d47cf4c0588caab22a0dbfa14"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
"chrono",
"either",
"indexmap 2.2.6",
@ -508,9 +508,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "changesets"
version = "0.2.2"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcf07f590d03d31b8c8fac9fbefead153de37cc9a621d294e20174fb7279f63e"
checksum = "2cc9a2cd1dfcbaf58c5a8552616ee811323cc614ffa612857b0ff610b5335b0e"
[[package]]
name = "chrono"
@ -1523,9 +1523,9 @@ dependencies = [
[[package]]
name = "getrandom"
version = "0.2.12"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
dependencies = [
"cfg-if",
"js-sys",
@ -1630,7 +1630,7 @@ version = "0.13.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
]
[[package]]
@ -1639,7 +1639,7 @@ version = "0.14.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
"allocator-api2",
]
@ -1714,9 +1714,9 @@ dependencies = [
[[package]]
name = "http"
version = "0.2.11"
version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb"
checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1"
dependencies = [
"bytes",
"fnv",
@ -1748,9 +1748,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
[[package]]
name = "hyper"
version = "0.14.28"
version = "0.14.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80"
checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9"
dependencies = [
"bytes",
"futures-channel",
@ -2148,6 +2148,15 @@ dependencies = [
"hashbrown 0.13.2",
]
[[package]]
name = "lz4_flex"
version = "0.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5"
dependencies = [
"twox-hash",
]
[[package]]
name = "mach"
version = "0.3.2"
@ -2157,6 +2166,21 @@ dependencies = [
"libc",
]
[[package]]
name = "mach2"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709"
dependencies = [
"libc",
]
[[package]]
name = "managed"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d"
[[package]]
name = "matchers"
version = "0.1.0"
@ -2802,7 +2826,7 @@ dependencies = [
name = "preset_env_base"
version = "0.5.1"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
"anyhow",
"browserslist-rs",
"dashmap",
@ -3045,14 +3069,14 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "region"
version = "3.0.0"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e"
checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7"
dependencies = [
"bitflags 1.3.2",
"libc",
"mach",
"winapi",
"mach2",
"windows-sys 0.52.0",
]
[[package]]
@ -3407,21 +3431,9 @@ dependencies = [
[[package]]
name = "serde_yaml"
version = "0.8.26"
version = "0.9.34+deprecated"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b"
dependencies = [
"indexmap 1.9.3",
"ryu",
"serde",
"yaml-rust",
]
[[package]]
name = "serde_yaml"
version = "0.9.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38"
checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47"
dependencies = [
"indexmap 2.2.6",
"itoa",
@ -3536,6 +3548,17 @@ version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c"
[[package]]
name = "smoltcp"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee34c1e1bfc7e9206cc0fb8030a90129b4e319ab53856249bb27642cab914fb3"
dependencies = [
"bitflags 1.3.2",
"byteorder",
"managed",
]
[[package]]
name = "socket2"
version = "0.4.10"
@ -3799,7 +3822,7 @@ dependencies = [
name = "swc_cached"
version = "0.3.20"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
"anyhow",
"dashmap",
"once_cell",
@ -3835,7 +3858,7 @@ dependencies = [
name = "swc_common"
version = "0.36.1"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
"anyhow",
"arbitrary",
"ast_node",
@ -4969,7 +4992,7 @@ dependencies = [
name = "swc_estree_compat"
version = "0.207.1"
dependencies = [
"ahash 0.8.8",
"ahash 0.8.11",
"anyhow",
"codspeed-criterion-compat",
"copyless",
@ -5635,9 +5658,9 @@ dependencies = [
[[package]]
name = "time"
version = "0.3.34"
version = "0.3.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
dependencies = [
"deranged",
"itoa",
@ -5656,9 +5679,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
[[package]]
name = "time-macros"
version = "0.2.17"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
dependencies = [
"num-conv",
"time-core",
@ -5914,6 +5937,16 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b"
[[package]]
name = "twox-hash"
version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [
"cfg-if",
"static_assertions",
]
[[package]]
name = "typed-arena"
version = "2.0.2"
@ -5994,9 +6027,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
[[package]]
name = "unsafe-libyaml"
version = "0.2.10"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b"
checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861"
[[package]]
name = "url"
@ -6087,9 +6120,9 @@ dependencies = [
[[package]]
name = "virtual-mio"
version = "0.3.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9f38a379f14296f9fb93eda42ece4d57b568af417569102c3dcfeb88ab4800f"
checksum = "ff8026c9d7575dc9afd8a0907357acb7aa55ec262097fbccae5da42f67773b3c"
dependencies = [
"async-trait",
"bytes",
@ -6104,20 +6137,24 @@ dependencies = [
[[package]]
name = "virtual-net"
version = "0.6.2"
version = "0.6.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75b66781480898ee7ee62a2bbe2955ce1bb5a90fdc8bfedbdabe3537b177fa3e"
checksum = "74aa69bbb19e531d274ba1aa730028f6fcd2117513ff6696d020af05188dfe92"
dependencies = [
"anyhow",
"async-trait",
"base64",
"bincode",
"bytecheck",
"bytes",
"derivative",
"futures-util",
"pin-project-lite",
"rkyv",
"serde",
"smoltcp",
"thiserror",
"tokio",
"tracing",
"virtual-mio",
]
@ -6188,9 +6225,9 @@ dependencies = [
[[package]]
name = "wai-bindgen-wasmer"
version = "0.18.0"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00f4a7cb5421959864b139870a7ebba26eafc9b46648feda9ac143528e9a8769"
checksum = "39a8ae4f43b477b58e5f69924983a82136ccbaceccf5fac8e069bbd64f55a964"
dependencies = [
"anyhow",
"bitflags 1.3.2",
@ -6343,9 +6380,9 @@ dependencies = [
[[package]]
name = "wasmer"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5467c7a23f9be04d5691590bea509dbea27e5ba5810d0020bef908456a495f33"
checksum = "5c15724dc25d1ee57962334aea8e41ade2675e5ea2ac6b8d42da6051b0face66"
dependencies = [
"bytes",
"cfg-if",
@ -6359,23 +6396,23 @@ dependencies = [
"shared-buffer",
"target-lexicon",
"thiserror",
"tracing",
"wasm-bindgen",
"wasmer-compiler",
"wasmer-compiler-cranelift",
"wasmer-derive",
"wasmer-types",
"wasmer-vm",
"wasmparser 0.83.0",
"wasmparser 0.95.0",
"wasmparser",
"wat",
"winapi",
]
[[package]]
name = "wasmer-cache"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1613ff5e7db7645eab2f003411b1e7a12dcf0ff4677f6e7712ba74ebf40b276"
checksum = "e3242b5cf4d27d33daa44b60b153365f733e9fb833cf61594e577ae55456e85f"
dependencies = [
"blake3",
"hex",
@ -6385,9 +6422,9 @@ dependencies = [
[[package]]
name = "wasmer-compiler"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "510ad01a668d774f3a103a7c219bbc0970be93e8f1b27e2fdb48d1f4ccd1deff"
checksum = "55a7f3b3a96f8d844c25e2c032af9572306dd63fa93dc17bcca4c5458ac569bd"
dependencies = [
"backtrace",
"bytes",
@ -6406,15 +6443,15 @@ dependencies = [
"thiserror",
"wasmer-types",
"wasmer-vm",
"wasmparser 0.95.0",
"wasmparser",
"winapi",
]
[[package]]
name = "wasmer-compiler-cranelift"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "54bf93078990d83960d798de3c5935bddaba771fc2fefb9ed6bab9c0bbdea5c1"
checksum = "102e2c5bacac69495c4025767e2fa26797ffb27f242dccb7cf57d9cefd944386"
dependencies = [
"cranelift-codegen",
"cranelift-entity",
@ -6431,9 +6468,9 @@ dependencies = [
[[package]]
name = "wasmer-derive"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b374fd34d97b1c091d8675f9bc472df52dc6787d139d3762d42c7dc84813a9b"
checksum = "0ea737fa08f95d6abc4459f42a70a9833e8974b814e74971d77ef473814f4d4c"
dependencies = [
"proc-macro-error",
"proc-macro2",
@ -6441,6 +6478,31 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "wasmer-journal"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0f7db07627d56d4b714255d8f1f7f07378dd5a3bc67e612ece42afa7e4a0e477"
dependencies = [
"anyhow",
"async-trait",
"base64",
"bincode",
"bytecheck",
"bytes",
"derivative",
"lz4_flex",
"num_enum",
"rkyv",
"serde",
"serde_json",
"thiserror",
"tracing",
"virtual-net",
"wasmer",
"wasmer-wasix-types",
]
[[package]]
name = "wasmer-toml"
version = "0.9.2"
@ -6454,16 +6516,16 @@ dependencies = [
"serde",
"serde_cbor",
"serde_json",
"serde_yaml 0.9.30",
"serde_yaml",
"thiserror",
"toml 0.8.8",
]
[[package]]
name = "wasmer-types"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0caf1c87937b52aba8e9f920a278e1beda282f7439612c0b48f51a58e7a87bab"
checksum = "b0689110e291b0f07fc665f2824e5ff81df120848e8a9acfbf1a9bf7990773f9"
dependencies = [
"bytecheck",
"enum-iterator",
@ -6478,9 +6540,9 @@ dependencies = [
[[package]]
name = "wasmer-vm"
version = "4.2.5"
version = "4.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58315c25492bc72a33f47a7d7fb0869a0106fc0164ec051e349a9e1eddba9a01"
checksum = "4cd41f822a1ac4242d478754e8ceba2806a00ea5072803622e1fe91e8e28b2a1"
dependencies = [
"backtrace",
"cc",
@ -6506,13 +6568,15 @@ dependencies = [
[[package]]
name = "wasmer-wasix"
version = "0.18.0"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9697b8ffc3a37c193648919018848171de0d75e6e955377893d258431b19d7a"
checksum = "25cd997abba5a5b59bad212c53f953eff28c7cee38b67b989b114cf5b80e9625"
dependencies = [
"anyhow",
"async-trait",
"base64",
"bincode",
"bytecheck",
"bytes",
"cfg-if",
"chrono",
@ -6528,18 +6592,22 @@ dependencies = [
"lazy_static",
"libc",
"linked_hash_set",
"lz4_flex",
"num_enum",
"once_cell",
"petgraph",
"pin-project",
"rand",
"rkyv",
"rusty_pool",
"semver 1.0.21",
"serde",
"serde_cbor",
"serde_derive",
"serde_json",
"serde_yaml 0.8.26",
"serde_yaml",
"sha2",
"shared-buffer",
"tempfile",
"term_size",
"termios",
@ -6556,6 +6624,7 @@ dependencies = [
"wasm-bindgen",
"wasm-bindgen-futures",
"wasmer",
"wasmer-journal",
"wasmer-types",
"wasmer-wasix-types",
"web-sys",
@ -6567,9 +6636,9 @@ dependencies = [
[[package]]
name = "wasmer-wasix-types"
version = "0.18.0"
version = "0.18.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "65ca293eae6e3af6e4fd9fe1c8e096151d4f06cbb405ce5dd65edb779aba42d9"
checksum = "a1be275d30cc4c69cd2d52d4fee2e83feb3f35b381497d3f7c71ad5a4cde24d8"
dependencies = [
"anyhow",
"bitflags 1.3.2",
@ -6591,18 +6660,13 @@ dependencies = [
[[package]]
name = "wasmparser"
version = "0.83.0"
version = "0.121.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a"
[[package]]
name = "wasmparser"
version = "0.95.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a"
checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab"
dependencies = [
"indexmap 1.9.3",
"url",
"bitflags 2.5.0",
"indexmap 2.2.6",
"semver 1.0.21",
]
[[package]]
@ -6946,18 +7010,9 @@ dependencies = [
[[package]]
name = "xxhash-rust"
version = "0.8.8"
version = "0.8.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53be06678ed9e83edb1745eb72efc0bbcd7b5c3c35711a860906aed827a13d61"
[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
dependencies = [
"linked-hash-map",
]
checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb"
[[package]]
name = "yansi"

View File

@ -1,8 +0,0 @@
#[cfg(all(feature = "binding_node", feature = "binding_wasm",))]
compile_error!(
"Macro cannot enable multiple bindings builder at once. Enable only one binding feature"
);
fn main() {
//noop
}

View File

@ -74,7 +74,7 @@ impl CheckSizeCommand {
println!(
"{}: {} bytes (swc) vs {} bytes (terser)",
file.path
.strip_prefix(&self.workspace.join("inputs"))
.strip_prefix(self.workspace.join("inputs"))
.unwrap()
.display(),
file.swc,
@ -92,7 +92,7 @@ impl CheckSizeCommand {
format!(
"{}: Diff: {} bytes; {} bytes (swc) vs {} bytes (terser)",
f.path
.strip_prefix(&self.workspace.join("inputs"))
.strip_prefix(self.workspace.join("inputs"))
.unwrap()
.display(),
f.swc as i32 - f.terser as i32,

View File

@ -62,7 +62,7 @@ fn files_group(c: &mut Criterion) {
group.sample_size(10);
let mut bench_file = |name: &str| {
group.bench_function(&format!("es/full/minify/libraries/{name}"), |b| {
group.bench_function(format!("es/full/minify/libraries/{name}"), |b| {
bench_minify(b, &format!("{}.js", name));
});
};

View File

@ -15,9 +15,6 @@ mod computed_key;
mod merge;
mod plan;
#[derive(Debug, Default)]
struct State {}
impl<L, R> Bundler<'_, L, R>
where
L: Load,

View File

@ -1,5 +1,3 @@
#![cfg_attr(not(feature = "serde-impl"), allow(unused))]
use ast_node::ast_node;
use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion};
use serde::{Deserialize, Serialize};
@ -65,32 +63,5 @@ fn bench_serde(c: &mut Criterion) {
});
}
fn bench_ast_node(c: &mut Criterion) {
#[cfg(feature = "serde-impl")]
c.bench_function("serialization of ast node", |b| {
let src = AstNode::String(Str {
span: DUMMY_SP,
value: String::from("perf-diff"),
});
b.iter(|| black_box(serde_json::to_string(&src).unwrap()));
});
#[cfg(feature = "serde-impl")]
c.bench_function("deserialization of ast node", |b| {
let src = serde_json::to_string(&AstNode::String(Str {
span: DUMMY_SP,
value: String::from("perf-diff"),
}))
.unwrap();
println!("{}", src);
b.iter(|| {
let t: AstNode = serde_json::from_str(&src).unwrap();
black_box(t);
});
});
}
criterion_group!(benches, bench_ast_node, bench_serde);
criterion_group!(benches, bench_serde);
criterion_main!(benches);

View File

@ -390,4 +390,5 @@ swc_plugin_runner = { optional = true, version = "0.111.0", path = "../swc_plugi
vergen = { workspace = true, features = ["cargo"] }
[dev-dependencies]
anyhow = { workspace = true }
anyhow = { workspace = true }
testing = { version = "0.38.0", path = "../testing" }

View File

@ -9,7 +9,7 @@ use vergen::EmitBuilder;
// Validate conflict between host / plugin features
#[cfg(all(
feature = "plugin_transform",
feature = "ecma_plugin_transform",
any(
feature = "plugin_transform_host_native",
feature = "plugin_transform_host_js"
@ -21,15 +21,6 @@ compile_error!(
run plugin, use 'plugin_transform_host_*' instead."
);
#[cfg(all(feature = "__plugin_transform", feature = "common_concurrent"))]
compile_error!("plugin transform cannot enable concurrent mode.");
#[cfg(all(feature = "transforms", feature = "transforms_concurrent"))]
compile_error!(
"'transforms' and 'transforms_concurrent' features are mutually exclusive. Please choose only \
one feature."
);
fn main() {
// Creates a static compile time constants for the version of swc_core.
let pkg_version = env::var("CARGO_PKG_VERSION").unwrap();

View File

@ -32,7 +32,7 @@ pub extern crate swc_ecma_quote_macros;
)]
pub mod plugin;
#[cfg(feature = "preset_env")]
#[cfg(feature = "ecma_preset_env")]
#[cfg_attr(docsrs, doc(cfg(feature = "preset_env")))]
pub mod preset_env {
pub use preset_env_base::*;

View File

@ -1,13 +1,13 @@
#[cfg(feature = "quote")]
use swc_core::{ast::Ident, common::DUMMY_SP, quote, quote_expr, utils::private_ident};
#[cfg(feature = "ecma_quote")]
use swc_core::{common::DUMMY_SP, ecma::ast::Ident, ecma::utils::private_ident, quote, quote_expr};
#[cfg(feature = "quote")]
#[cfg(feature = "ecma_quote")]
#[test]
fn quote_expr_call_1() {
let _expr = quote_expr!("call(arg1, typeof arg2, arg3)");
}
#[cfg(feature = "quote")]
#[cfg(feature = "ecma_quote")]
#[test]
fn quote_expr_var_cloned() {
testing::run_test2(false, |_cm, _handler| {
@ -20,31 +20,31 @@ fn quote_expr_var_cloned() {
.unwrap();
}
#[cfg(feature = "quote")]
#[cfg(feature = "ecma_quote")]
#[test]
fn quote_example() {
let _stmt = quote!(
"const $name = 4;" as Stmt,
name = Ident::new("ref".into(), DUMMY_SP)
name = Ident::new("ref".into(), DUMMY_SP, Default::default())
);
}
#[cfg(feature = "quote")]
#[cfg(feature = "ecma_quote")]
#[test]
fn quote_var_type_expr() {
let _stmt = quote!(
"const $name = $val;" as Stmt,
name = Ident::new("ref".into(), DUMMY_SP),
name = Ident::new("ref".into(), DUMMY_SP, Default::default()),
val: Expr = 4.into(),
);
}
#[cfg(feature = "quote")]
#[cfg(feature = "ecma_quote")]
#[test]
fn quote_var_type_pat() {
let _stmt = quote!(
"const $name = $val;" as Stmt,
name: Pat = Ident::new("ref".into(), DUMMY_SP).into(),
val: Ident = Ident::new("val".into(), DUMMY_SP),
name: Pat = Ident::new("ref".into(), DUMMY_SP, Default::default()).into(),
val: Ident = Ident::new("val".into(), DUMMY_SP, Default::default()),
);
}

View File

@ -2792,7 +2792,7 @@ fn serialize_dimension_unit(value: &str) -> Cow<'_, str> {
// Fast-path
let need_escape =
(value.len() >= 2 && value.as_bytes()[0] == b'e' && value.as_bytes()[1].is_ascii_digit())
|| value.contains(|c| c == char::REPLACEMENT_CHARACTER);
|| value.contains(char::REPLACEMENT_CHARACTER);
if !need_escape {
return Cow::Borrowed(value);

View File

@ -255,7 +255,7 @@ impl CustomMediaHandler {
Some((query.modifier.clone(), query.media_type.clone()));
}
for condition in &query.condition {
if let Some(condition) = &query.condition {
match &**condition {
MediaConditionType::All(media_condition) => {
if new_media_condition.conditions.is_empty() {

View File

@ -489,5 +489,5 @@ impl VisitMut for Compressor {
}
fn contains_only_ascii_characters(string: &str) -> bool {
string.chars().all(|c: char| c.is_ascii())
string.is_ascii()
}

View File

@ -22,7 +22,7 @@ pub struct Class {
pub ctxt: SyntaxContext,
#[cfg_attr(c, serde(default))]
#[cfg_attr(feature = "serde-impl", serde(default))]
pub decorators: Vec<Decorator>,
#[cfg_attr(feature = "serde-impl", serde(default))]

View File

@ -3908,7 +3908,7 @@ fn get_template_element_from_raw(s: &str, ascii_only: bool) -> String {
}
fn get_ascii_only_ident(sym: &str, may_need_quote: bool, target: EsVersion) -> Cow<str> {
if sym.chars().all(|c| c.is_ascii()) {
if sym.is_ascii() {
return Cow::Borrowed(sym);
}

View File

@ -12,23 +12,6 @@ pub(crate) struct InjectSelf {
pub parser: Option<Ident>,
}
#[cfg(procmacro2_semver_exempt)]
fn get_joined_span(t: &dyn ToTokens) -> Span {
let tts: TokenStream = t.dump().into();
let (mut first, mut last) = (None, None);
for tt in tts {
match first {
None => first = Some(tt.span()),
_ => {}
}
last = Some(tt.span());
}
let cs = Span::call_site();
first.unwrap_or(cs).join(last.unwrap_or(cs)).unwrap_or(cs)
}
#[cfg(not(procmacro2_semver_exempt))]
fn get_joined_span(t: &dyn ToTokens) -> Span {
let tts: TokenStream = t.into_token_stream();
let mut first = None;

View File

@ -420,11 +420,8 @@ fn emit_error(name: &str, span: Span, prev_span: Span) {
span,
&format!("the name `{}` is defined multiple times", name),
)
.span_label(
prev_span,
&format!("previous definition of `{}` here", name),
)
.span_label(span, &format!("`{}` redefined here", name))
.span_label(prev_span, format!("previous definition of `{}` here", name))
.span_label(span, format!("`{}` redefined here", name))
.emit();
});
}

View File

@ -25,7 +25,7 @@ fn error(first: &BindingIdent, second: &BindingIdent) {
),
)
.span_label(first.span, "previous definition here".to_string())
.span_label(second.span, &"used as parameter more than once".to_string())
.span_label(second.span, "used as parameter more than once".to_string())
.emit();
});
}

View File

@ -23,7 +23,7 @@ pub fn bench_files(c: &mut Criterion) {
let mut bench_file = |name: &str| {
let src = read_to_string(format!("benches/full/{}.js", name)).unwrap();
group.bench_function(&format!("es/minifier/libs/{}", name), |b| {
group.bench_function(format!("es/minifier/libs/{}", name), |b| {
b.iter(|| {
// We benchmark full time, including time for creating cm, handler
let allocator = Allocator::default();

View File

@ -13,11 +13,8 @@ impl Pure<'_> {
if !self.options.props {
return None;
}
if let Some(obj) = obj {
match obj {
Expr::Array(..) | Expr::Await(..) | Expr::Yield(..) | Expr::Lit(..) => return None,
_ => {}
}
if let Some(Expr::Array(..) | Expr::Await(..) | Expr::Yield(..) | Expr::Lit(..)) = obj {
return None;
}
match &*c.expr {

View File

@ -9,6 +9,7 @@ use crate::HEAVY_TASK_PARALLELS;
/// Optimizer invoked before invoking compressor.
///
/// - Remove parens.
///
/// TODO: remove completely after #8333
pub(crate) fn precompress_optimizer<'a>() -> impl 'a + VisitMut {
PrecompressOptimizer {}

View File

@ -60,12 +60,12 @@ const LOG: bool = false && cfg!(debug_assertions);
/// 3. Defined `a` with syntax context of the block statement.
///
/// 4. Found usage of `a`, and determines that it's reference to `a` in the
/// block. So the reference to `a` will have same syntax context as `a` in the
/// block.
/// block. So the reference to `a` will have same syntax context as `a` in
/// the block.
///
/// 5. Found usage of `a` (last line), and determines that it's a
/// reference to top-level `a`, and change syntax context of `a` on last line to
/// top-level syntax context.
/// 5. Found usage of `a` (last line), and determines that it's a reference to
/// top-level `a`, and change syntax context of `a` on last line to top-level
/// syntax context.
///
///
/// # Parameters

View File

@ -30,3 +30,9 @@ impl Parallel for ExampleFold {
#[parallel]
impl Fold for ExampleFold {}
#[test]
fn test() {
let _ = ExampleFold;
let _ = ExampleVisitMut;
}

View File

@ -42,3 +42,10 @@ impl ParExplode for ExampleFold {
#[parallel(explode)]
impl Fold for ExampleFold {}
#[test]
fn test_1() {
let _ = ExampleFold;
let _ = ExampleVisitMut;
}

View File

@ -232,15 +232,6 @@ pub(super) fn use_strict() -> Stmt {
Lit::Str(quote_str!("use strict")).into_stmt()
}
/// Private `_exports` ident.
pub(super) struct Exports(#[allow(dead_code)] pub Ident);
impl Default for Exports {
fn default() -> Self {
Exports(private_ident!("_exports"))
}
}
pub(crate) fn object_define_enumerable(
target: ExprOrSpread,
prop_name: ExprOrSpread,

View File

@ -659,7 +659,7 @@ fn exec_with_node_test_runner(src: &str) -> Result<(), ()> {
};
let output = base_cmd
.arg(&format!("{}", path.display()))
.arg(format!("{}", path.display()))
.arg("--color")
.current_dir(root)
.output()

View File

@ -42,8 +42,9 @@ pub struct TsxConfig {
#[derive(Default, Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum TsImportExportAssignConfig {
/// - Rewrite `import foo = require("foo")` to `var foo = require("foo")`
/// - Rewrite `export =` to `module.exports = `
/// - Rewrite `import foo = require("foo")` to `var foo = require("foo")`
/// - Rewrite `export =` to `module.exports = `
///
/// Note: This option is deprecated as all CJS/AMD/UMD can handle it
/// themselves.
#[default]

View File

@ -18,8 +18,9 @@ bench = false
[features]
# This enables global concurrent mode
concurrent = ["swc_common/concurrent", "indexmap/rayon"]
trace-ast = []
concurrent = ["swc_common/concurrent", "indexmap/rayon"]
trace-ast = []
tracing-spans = []
[dependencies]
indexmap = { workspace = true }

View File

@ -225,7 +225,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_arrow_expr(&mut self, n: &ArrowExpr) {
self.with_child(n.ctxt, ScopeKind::Fn, |child| {
{
@ -248,7 +248,7 @@ where
})
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_assign_expr(&mut self, n: &AssignExpr) {
let is_op_assign = n.op != op!("=");
n.left.visit_with(self);
@ -314,7 +314,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_await_expr(&mut self, n: &AwaitExpr) {
let ctx = Ctx {
in_await_arg: true,
@ -361,19 +361,19 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_binding_ident(&mut self, n: &BindingIdent) {
self.visit_pat_id(&Ident::from(n));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_block_stmt(&mut self, n: &BlockStmt) {
self.with_child(n.ctxt, ScopeKind::Block, |child| {
n.visit_children_with(child);
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_call_expr(&mut self, n: &CallExpr) {
let inline_prevented = self.ctx.inline_prevented
|| self
@ -478,7 +478,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_catch_clause(&mut self, n: &CatchClause) {
{
let ctx = Ctx {
@ -498,7 +498,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_class(&mut self, n: &Class) {
n.decorators.visit_with(self);
@ -513,14 +513,14 @@ where
self.with_child(n.ctxt, ScopeKind::Fn, |child| n.body.visit_with(child))
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_class_decl(&mut self, n: &ClassDecl) {
self.declare_decl(&n.ident, true, None, false);
n.visit_children_with(self);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_class_expr(&mut self, n: &ClassExpr) {
n.visit_children_with(self);
@ -529,7 +529,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_class_method(&mut self, n: &ClassMethod) {
n.function.decorators.visit_with(self);
@ -547,7 +547,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_class_prop(&mut self, n: &ClassProp) {
let ctx = Ctx {
is_id_ref: true,
@ -557,7 +557,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_computed_prop_name(&mut self, n: &ComputedPropName) {
let ctx = Ctx {
is_id_ref: true,
@ -567,7 +567,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_cond_expr(&mut self, n: &CondExpr) {
n.test.visit_with(self);
@ -581,7 +581,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_constructor(&mut self, n: &Constructor) {
self.with_child(n.ctxt, ScopeKind::Fn, |child| {
{
@ -617,7 +617,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_do_while_stmt(&mut self, n: &DoWhileStmt) {
n.body.visit_with(&mut *self.with_ctx(Ctx {
executed_multiple_time: true,
@ -629,7 +629,7 @@ where
}));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_export_decl(&mut self, n: &ExportDecl) {
n.visit_children_with(self);
@ -651,7 +651,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_export_default_expr(&mut self, n: &ExportDefaultExpr) {
let ctx = Ctx {
is_id_ref: true,
@ -673,7 +673,7 @@ where
};
}
#[cfg_attr(feature = "debug", tracing::instrument(skip(self, e)))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip(self, e)))]
fn visit_expr(&mut self, e: &Expr) {
let ctx = Ctx {
in_pat_of_var_decl: false,
@ -687,7 +687,7 @@ where
e.visit_children_with(&mut *self.with_ctx(ctx));
if let Expr::Ident(i) = e {
#[cfg(feature = "debug")]
#[cfg(feature = "tracing-spans")]
{
// debug!(
// "Usage: `{}``; update = {:?}, assign_lhs = {:?} ",
@ -701,7 +701,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_expr_or_spread(&mut self, e: &ExprOrSpread) {
e.visit_children_with(self);
@ -714,7 +714,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_fn_decl(&mut self, n: &FnDecl) {
let ctx = Ctx {
in_decl_with_no_side_effect_for_member_access: true,
@ -747,7 +747,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_fn_expr(&mut self, n: &FnExpr) {
if let Some(n_id) = &n.ident {
self.data
@ -776,7 +776,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_for_in_stmt(&mut self, n: &ForInStmt) {
n.right.visit_with(self);
@ -803,7 +803,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_for_of_stmt(&mut self, n: &ForOfStmt) {
n.right.visit_with(self);
@ -827,7 +827,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_for_stmt(&mut self, n: &ForStmt) {
n.init.visit_with(self);
@ -842,7 +842,7 @@ where
self.with_ctx(ctx).visit_in_cond(&n.body);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_function(&mut self, n: &Function) {
n.decorators.visit_with(self);
@ -863,7 +863,7 @@ where
})
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_getter_prop(&mut self, n: &GetterProp) {
self.with_child(SyntaxContext::empty(), ScopeKind::Fn, |a| {
n.key.visit_with(a);
@ -872,7 +872,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_if_stmt(&mut self, n: &IfStmt) {
let ctx = Ctx {
in_cond: true,
@ -896,7 +896,7 @@ where
self.declare_decl(&n.local, true, None, false);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_jsx_element_name(&mut self, n: &JSXElementName) {
let ctx = Ctx {
in_pat_of_var_decl: false,
@ -914,7 +914,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip(self, e)))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip(self, e)))]
fn visit_member_expr(&mut self, e: &MemberExpr) {
{
let ctx = Ctx {
@ -949,7 +949,7 @@ where
})
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_method_prop(&mut self, n: &MethodProp) {
n.function.decorators.visit_with(self);
@ -982,7 +982,7 @@ where
n.visit_children_with(self);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_new_expr(&mut self, n: &NewExpr) {
{
n.callee.visit_with(self);
@ -1004,7 +1004,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_param(&mut self, n: &Param) {
let ctx = Ctx {
in_pat_of_param: false,
@ -1021,7 +1021,7 @@ where
n.pat.visit_with(&mut *self.with_ctx(ctx));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_pat(&mut self, n: &Pat) {
match n {
Pat::Ident(i) => {
@ -1037,7 +1037,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_private_method(&mut self, n: &PrivateMethod) {
n.function.decorators.visit_with(self);
@ -1055,7 +1055,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_private_prop(&mut self, n: &PrivateProp) {
let ctx = Ctx {
is_id_ref: true,
@ -1065,7 +1065,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx));
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_prop(&mut self, n: &Prop) {
let ctx = Ctx {
is_id_ref: true,
@ -1086,7 +1086,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx))
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_setter_prop(&mut self, n: &SetterProp) {
self.with_child(SyntaxContext::empty(), ScopeKind::Fn, |a| {
n.key.visit_with(a);
@ -1102,7 +1102,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_spread_element(&mut self, e: &SpreadElement) {
e.visit_children_with(self);
@ -1113,7 +1113,7 @@ where
});
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_stmt(&mut self, n: &Stmt) {
let ctx = Ctx {
in_await_arg: false,
@ -1139,7 +1139,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip(self, e)))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip(self, e)))]
fn visit_super_prop_expr(&mut self, e: &SuperPropExpr) {
if let SuperProp::Computed(c) = &e.prop {
let ctx = Ctx {
@ -1159,7 +1159,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx))
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_switch_stmt(&mut self, n: &SwitchStmt) {
n.discriminant.visit_with(self);
@ -1180,7 +1180,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_tagged_tpl(&mut self, n: &TaggedTpl) {
{
let ctx = Ctx {
@ -1202,7 +1202,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_tpl(&mut self, n: &Tpl) {
let ctx = Ctx {
is_id_ref: false,
@ -1212,7 +1212,7 @@ where
n.visit_children_with(&mut *self.with_ctx(ctx))
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_try_stmt(&mut self, n: &TryStmt) {
let ctx = Ctx {
in_cond: true,
@ -1222,7 +1222,7 @@ where
self.with_ctx(ctx).visit_children_in_cond(n);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_unary_expr(&mut self, n: &UnaryExpr) {
if n.op == op!("delete") {
self.mark_mutation_if_member(n.arg.as_member());
@ -1230,7 +1230,7 @@ where
n.visit_children_with(self);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_update_expr(&mut self, n: &UpdateExpr) {
n.visit_children_with(self);
@ -1238,7 +1238,7 @@ where
self.mark_mutation_if_member(n.arg.as_member());
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_var_decl(&mut self, n: &VarDecl) {
let ctx = Ctx {
var_decl_kind_of_pat: Some(n.kind),
@ -1264,7 +1264,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip(self, e)))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip(self, e)))]
fn visit_var_declarator(&mut self, e: &VarDeclarator) {
let prevent_inline = matches!(&e.name, Pat::Ident(BindingIdent {
id: Ident { sym: arguments, .. },
@ -1318,7 +1318,7 @@ where
}
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_while_stmt(&mut self, n: &WhileStmt) {
n.test.visit_with(&mut *self.with_ctx(Ctx {
executed_multiple_time: true,
@ -1333,7 +1333,7 @@ where
self.with_ctx(ctx).visit_in_cond(&n.body);
}
#[cfg_attr(feature = "debug", tracing::instrument(skip_all))]
#[cfg_attr(feature = "tracing-spans", tracing::instrument(skip_all))]
fn visit_with_stmt(&mut self, n: &WithStmt) {
self.scope.mark_with_stmt();
n.visit_children_with(self);

View File

@ -47,13 +47,13 @@ pub type FastDiGraphMap<N, E> = FastGraphMap<N, E, Directed>;
///
/// - Associated data `N` for nodes and `E` for edges, called *weights*.
/// - The node weight `N` must implement `Copy` and will be used as node
/// identifier, duplicated into several places in the data structure.
/// It must be suitable as a hash table key (implementing `Eq + Hash`).
/// The node type must also implement `Ord` so that the implementation can
/// order the pair (`a`, `b`) for an edge connecting any two nodes `a` and `b`.
/// identifier, duplicated into several places in the data structure. It must
/// be suitable as a hash table key (implementing `Eq + Hash`). The node type
/// must also implement `Ord` so that the implementation can order the pair
/// (`a`, `b`) for an edge connecting any two nodes `a` and `b`.
/// - `E` can be of arbitrary type.
/// - Edge type `Ty` that determines whether the graph edges are directed or
/// undirected.
/// undirected.
///
/// You can use the type aliases `UnGraphMap` and `DiGraphMap` for convenience.
///
@ -418,7 +418,7 @@ where
///
/// 1. Note that node and edge indices in the `Graph` have nothing in common
/// with the `GraphMap`s node weights `N`. The node weights `N` are used
/// as node weights in the resulting `Graph`, too.
/// as node weights in the resulting `Graph`, too.
/// 2. Note that the index type is user-chosen.
///
/// Computes in **O(|V| + |E|)** time (average).

View File

@ -620,8 +620,9 @@ where
None => true,
_ => false,
},
// The closing tag can be omitted if it is immediately followed by a <rb>, <rtc>
// or <rt> element opening tag or by its parent closing tag.
// The closing tag can be omitted if it is immediately followed by a <rb>,
// <rtc> or <rt> element opening tag or by its parent
// closing tag.
"rtc" => match next {
Some(Child::Element(Element {
namespace,

View File

@ -2108,7 +2108,7 @@ impl Minifier<'_> {
fn minify_sizes(&self, value: &str) -> Option<String> {
let values = value
.rsplitn(2, |c| matches!(c, '\t' | '\n' | '\x0C' | '\r' | ' '))
.rsplitn(2, ['\t', '\n', '\x0C', '\r', ' '])
.collect::<Vec<&str>>();
if values.len() != 2 {

View File

@ -63,7 +63,7 @@ fn html5lib_test_tokenizer(input: PathBuf) {
let filename = input.to_str().expect("failed to parse path");
let contents = fs::read_to_string(filename).expect("Something went wrong reading the file");
let obj: Value = serde_json::from_str(&contents).expect("json parse error");
let tests = match obj.get(&"tests".to_string()) {
let tests = match obj.get("tests".to_string()) {
Some(Value::Array(tests)) => tests,
_ => return,
};

View File

@ -2,8 +2,6 @@
extern crate proc_macro;
#[cfg(procmacro2_semver_exempt)]
use pmutil::SpanExt;
use proc_macro2::{Span, TokenStream};
use quote::ToTokens;
use syn::{punctuated::Pair, *};
@ -17,18 +15,10 @@ pub fn call_site() -> Span {
Span::call_site()
}
/// `Span::def_site().located_at(Span::call_site())`
#[cfg(not(procmacro2_semver_exempt))]
pub fn def_site() -> Span {
call_site()
}
/// `Span::def_site().located_at(Span::call_site())`
#[cfg(procmacro2_semver_exempt)]
pub fn def_site() -> Span {
Span::def_site().located_at(Span::call_site())
}
/// `attr` - tokens inside `#[]`. e.g. `derive(EqIgnoreSpan)`, ast_node
pub fn print(attr: &'static str, tokens: proc_macro2::TokenStream) -> proc_macro::TokenStream {
use std::env;

View File

@ -18,7 +18,7 @@
//! # `Fold`
//!
//! > WARNING: `Fold` is slow, and it's recommended to use VisitMut if you are
//! experienced.
//! > experienced.
//!
//!
//! `Fold` takes ownership of value, which means you have to return the new

View File

@ -35,7 +35,7 @@ pub struct Diff {
///
/// - The `CARGO_MANIFEST_DIR` directory is replaced with `$DIR`.
/// - All backslashes (\) within same line as `$DIR` are converted to forward
/// slashes (/) (for Windows) - All CR LF newlines are converted to LF
/// slashes (/) (for Windows) - All CR LF newlines are converted to LF
///
/// - `normalize-stdout` is not implemented (yet?).
#[derive(Clone, Ord, PartialOrd, PartialEq, Eq, Default, Hash)]

View File

@ -1 +1 @@
nightly-2024-04-16
nightly-2024-07-21