diff --git a/Cargo.lock b/Cargo.lock index 97319fd1..4f6d13f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -239,6 +239,18 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "breakpad-symbols" version = "0.21.1" @@ -707,6 +719,12 @@ dependencies = [ "syn", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futures-core" version = "0.3.30" @@ -744,17 +762,6 @@ dependencies = [ "slab", ] -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - [[package]] name = "gimli" version = "0.29.0" @@ -814,6 +821,20 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hstr" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96274be293b8877e61974a607105d09c84caebe9620b47774aa8a6b942042dd4" +dependencies = [ + "hashbrown", + "new_debug_unreachable", + "once_cell", + "phf", + "rustc-hash", + "triomphe", +] + [[package]] name = "iana-time-zone" version = "0.1.60" @@ -962,9 +983,9 @@ checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" [[package]] name = "js-source-scopes" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e117dec2d000e8f702f662dc601e6f075b05b3cf7fc24f1afa09f39581c91a93" +checksum = "adfdc25288ccb82b33c3aa3f14587fd920b825690f3c4f8c5385b1d8998e9a40" dependencies = [ "indexmap", "sourcemap", @@ -1369,16 +1390,39 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + [[package]] name = "phf_generator" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ - "phf_shared", + "phf_shared 0.11.2", "rand", ] +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "phf_shared" version = "0.10.0" @@ -1388,6 +1432,15 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.14" @@ -1446,12 +1499,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1506,23 +1553,17 @@ dependencies = [ ] [[package]] -name = "rand" -version = "0.8.5" +name = "radium" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "ppv-lite86", "rand_core", ] @@ -1531,9 +1572,6 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] [[package]] name = "range-collections" @@ -1892,14 +1930,16 @@ dependencies = [ [[package]] name = "sourcemap" -version = "7.1.1" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7768edd06c02535e0d50653968f46e1e0d3aa54742190d35dd9466f59de9c71" +checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" dependencies = [ "base64-simd", + "bitvec", "data-encoding", "debugid", "if_chain", + "rustc-hash", "rustc_version", "serde", "serde_json", @@ -1951,23 +1991,11 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", "serde", ] -[[package]] -name = "string_cache_codegen" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" -dependencies = [ - "phf_generator", - "phf_shared", - "proc-macro2", - "quote", -] - [[package]] name = "string_enum" version = "0.4.4" @@ -1988,23 +2016,21 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swc_atoms" -version = "0.5.9" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f54563d7dcba626d4acfe14ed12def7ecc28e004debe3ecd2c3ee07cc47e449" +checksum = "bb6567e4e67485b3e7662b486f1565bdae54bd5b9d6b16b2ba1a9babb1e42125" dependencies = [ + "hstr", "once_cell", "rustc-hash", "serde", - "string_cache", - "string_cache_codegen", - "triomphe", ] [[package]] name = "swc_common" -version = "0.32.2" +version = "0.33.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eef62cc9409135ad6770ca4d52aa443ee8367d5322a5c7cab4c0eb96644a6ee" +checksum = "a2f9706038906e66f3919028f9f7a37f3ed552f1b85578e93f4468742e2da438" dependencies = [ "ast_node", "better_scoped_tls", @@ -2017,7 +2043,6 @@ dependencies = [ "rustc-hash", "serde", "siphasher", - "string_cache", "swc_atoms", "swc_eq_ignore_macros", "swc_visit", @@ -2028,29 +2053,32 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.109.2" +version = "0.113.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df3fdd0752abca14a106322b4db96f954274adfb1fbef387866691ea4bc6fe4" +checksum = "0fa77fca9412729a3fe634e55c354f6c70c7983f127411ce8684e4c7edf32ed3" dependencies = [ "bitflags 2.5.0", "is-macro", "num-bigint", + "phf", "scoped-tls", "string_enum", "swc_atoms", "swc_common", - "unicode-id", + "unicode-id-start", ] [[package]] name = "swc_ecma_parser" -version = "0.140.1" +version = "0.144.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316c11593fc4f52a81446fae0e1f1d32836c00f546eb80405024c04cd5f8bec6" +checksum = "0499e69683ae5d67a20ff0279b94bc90f29df7922a46331b54d5dd367bf89570" dependencies = [ "either", + "new_debug_unreachable", "num-bigint", "num-traits", + "phf", "serde", "smallvec", "smartstring", @@ -2064,9 +2092,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.95.2" +version = "0.99.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2decba8d98d8ecb241e3a75df568bb3818c657adeef7bc2025335a1efbd92d60" +checksum = "28a6ce28ad8e591f8d627f1f9cb26b25e5d83052a9bc1b674d95fc28040cfa98" dependencies = [ "num-bigint", "swc_atoms", @@ -2320,6 +2348,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tempfile" version = "3.10.1" @@ -2524,17 +2558,11 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" -[[package]] -name = "unicode-id" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" - [[package]] name = "unicode-id-start" -version = "1.1.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" +checksum = "02aebfa694eccbbbffdd92922c7de136b9fe764396d2f10e21bce1681477cfc1" [[package]] name = "unicode-ident" @@ -2892,6 +2920,15 @@ version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + [[package]] name = "yaxpeax-arch" version = "0.2.8" diff --git a/Cargo.toml b/Cargo.toml index 0b8a5c7b..b39e6156 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ goblin = { version = "0.8.0", default-features = false } indexmap = "2.0.0" insta = { version = "1.28.0", features = ["yaml"] } itertools = "0.13.0" -js-source-scopes = "0.4.0" +js-source-scopes = "0.5.0" lazy_static = "1.4.0" memmap2 = "0.9.0" minidump = "0.21.0" @@ -50,7 +50,7 @@ serde = { version = "1.0.171", features = ["derive"] } serde_json = "1.0.102" similar-asserts = "1.4.2" smallvec = "1.10.0" -sourcemap = "7.0.0" +sourcemap = "8.0.1" stable_deref_trait = "1.2.0" symbolic = { version = "12.8.0", path = "symbolic" } symbolic-cfi = { version = "12.8.0", path = "symbolic-cfi" } diff --git a/symbolic-cabi/src/sourcemap.rs b/symbolic-cabi/src/sourcemap.rs index 70a78e41..2c0fa80f 100644 --- a/symbolic-cabi/src/sourcemap.rs +++ b/symbolic-cabi/src/sourcemap.rs @@ -1,4 +1,3 @@ -use std::borrow::Cow; use std::ops::Deref; use std::os::raw::c_char; use std::ptr; @@ -11,7 +10,7 @@ use crate::utils::ForeignObject; pub struct SymbolicSourceView; impl ForeignObject for SymbolicSourceView { - type RustObject = sourcemap::SourceView<'static>; + type RustObject = sourcemap::SourceView; } enum SourceMapType { @@ -72,10 +71,7 @@ ffi_fn! { len: usize, ) -> Result<*mut SymbolicSourceView> { let slice = slice::from_raw_parts(bytes as *const _, len); - let view = match String::from_utf8_lossy(slice) { - Cow::Owned(s) => sourcemap::SourceView::from_string(s), - Cow::Borrowed(s) => sourcemap::SourceView::new(s), - }; + let view = sourcemap::SourceView::new(String::from_utf8_lossy(slice).into()); Ok(SymbolicSourceView::from_rust(view)) } }