diff --git a/Cargo.lock b/Cargo.lock index b7597b853b2..83385e44827 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -394,7 +394,7 @@ dependencies = [ "libc", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "windows-sys 0.52.0", ] @@ -512,7 +512,7 @@ dependencies = [ "serde", "serde-untagged", "serde-value", - "thiserror", + "thiserror 1.0.69", "toml 0.8.16", "unicode-xid", "url", @@ -520,16 +520,16 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc309ed89476c8957c50fb818f56fe894db857866c3e163335faa91dc34eb85" +checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" dependencies = [ "camino", "cargo-platform", "semver", "serde", "serde_json", - "thiserror", + "thiserror 2.0.4", ] [[package]] @@ -786,7 +786,7 @@ dependencies = [ "percent-encoding", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "url", ] @@ -999,7 +999,7 @@ dependencies = [ "console", "shell-words", "tempfile", - "thiserror", + "thiserror 1.0.69", "zeroize", ] @@ -1418,7 +1418,7 @@ dependencies = [ "once_cell", "prodash", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1431,7 +1431,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror", + "thiserror 1.0.69", "winnow", ] @@ -1448,7 +1448,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror", + "thiserror 1.0.69", "unicode-bom", ] @@ -1458,7 +1458,7 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a371db66cbd4e13f0ed9dc4c0fea712d7276805fccc877f77e96374d317e87ae" dependencies = [ - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1467,7 +1467,7 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c8751169961ba7640b513c3b24af61aa962c967aaf04116734975cd5af0c52" dependencies = [ - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1493,7 +1493,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1512,7 +1512,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.69", "unicode-bom", "winnow", ] @@ -1527,7 +1527,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1544,7 +1544,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1555,7 +1555,7 @@ checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" dependencies = [ "bstr", "itoa", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -1568,7 +1568,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1588,7 +1588,7 @@ dependencies = [ "gix-trace", "gix-utils", "gix-worktree", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1604,7 +1604,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1625,7 +1625,7 @@ dependencies = [ "parking_lot", "prodash", "sha1_smol", - "thiserror", + "thiserror 1.0.69", "walkdir", ] @@ -1647,7 +1647,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1680,7 +1680,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93d7df7366121b5018f947a04d37f034717e113dcf9ccd85c34b58e57a74d5e" dependencies = [ "faster-hex", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1732,7 +1732,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1743,7 +1743,7 @@ checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1770,7 +1770,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1788,7 +1788,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror", + "thiserror 1.0.69", "winnow", ] @@ -1809,7 +1809,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1829,7 +1829,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1841,7 +1841,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1853,7 +1853,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1866,7 +1866,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1881,7 +1881,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1894,7 +1894,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1911,7 +1911,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror", + "thiserror 1.0.69", "winnow", ] @@ -1923,7 +1923,7 @@ checksum = "cbff4f9b9ea3fa7a25a70ee62f545143abef624ac6aa5884344e70c8b0a1d9ff" dependencies = [ "bstr", "gix-utils", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1943,7 +1943,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror", + "thiserror 1.0.69", "winnow", ] @@ -1958,7 +1958,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1972,7 +1972,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1987,7 +1987,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2014,7 +2014,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2052,7 +2052,7 @@ dependencies = [ "gix-quote", "gix-sec", "gix-url", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2069,7 +2069,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2082,7 +2082,7 @@ dependencies = [ "gix-features", "gix-path", "home", - "thiserror", + "thiserror 1.0.69", "url", ] @@ -2104,7 +2104,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" dependencies = [ "bstr", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -2742,7 +2742,7 @@ checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ "cfg-if", "miette-derive", - "thiserror", + "thiserror 1.0.69", "unicode-width", ] @@ -3407,7 +3407,7 @@ checksum = "4cef0c817217c330b3ef879e06455d726c1cffc800eaf7734d3b4ac63213636b" dependencies = [ "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tracing", ] @@ -3930,7 +3930,16 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +dependencies = [ + "thiserror-impl 2.0.4", ] [[package]] @@ -3944,6 +3953,17 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "thiserror-impl" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "thread_local" version = "1.1.7" diff --git a/guppy/Cargo.toml b/guppy/Cargo.toml index 219df0bf529..62591ebea38 100644 --- a/guppy/Cargo.toml +++ b/guppy/Cargo.toml @@ -31,7 +31,7 @@ maintenance = { status = "actively-developed" } [dependencies] ahash.workspace = true camino = "1.1.7" -cargo_metadata = "0.19.0" +cargo_metadata = "0.19.1" cfg-if = "1.0.0" debug-ignore = "1.0.5" guppy-summaries = { version = "0.7.1", path = "../guppy-summaries", optional = true } diff --git a/guppy/src/graph/build.rs b/guppy/src/graph/build.rs index 802a6872af8..4a8cb065fa4 100644 --- a/guppy/src/graph/build.rs +++ b/guppy/src/graph/build.rs @@ -590,7 +590,7 @@ impl<'a> BuildTargets<'a> { let mut target_kinds = target .kind .into_iter() - .map(target_kind_to_string) + .map(|kind| kind.to_string()) .collect::>(); let target_name = target.name.into_boxed_str(); // Store crate types as strings to avoid exposing cargo_metadata in the @@ -599,7 +599,7 @@ impl<'a> BuildTargets<'a> { target .crate_types .into_iter() - .map(crate_type_to_string) + .map(|ct| ct.to_string()) .collect::>(), ); @@ -705,44 +705,6 @@ impl<'a> BuildTargets<'a> { } } -fn crate_type_to_string(ct: CrateType) -> String { - match ct { - CrateType::Bin => "bin".to_string(), - CrateType::CDyLib => "cdylib".to_string(), - CrateType::DyLib => "dylib".to_string(), - CrateType::Lib => "lib".to_string(), - CrateType::ProcMacro => "proc-macro".to_string(), - CrateType::RLib => "rlib".to_string(), - CrateType::StaticLib => "staticlib".to_string(), - CrateType::Unknown(s) => s, - _ => panic!( - "unknown crate type -- this impl should have been \ - replaced with https://github.com/oli-obk/cargo_metadata/issues/275" - ), - } -} - -fn target_kind_to_string(tk: TargetKind) -> String { - match tk { - TargetKind::Bench => "bench".to_string(), - TargetKind::Bin => "bin".to_string(), - TargetKind::CustomBuild => "custom-build".to_string(), - TargetKind::CDyLib => "cdylib".to_string(), - TargetKind::DyLib => "dylib".to_string(), - TargetKind::Example => "example".to_string(), - TargetKind::Lib => "lib".to_string(), - TargetKind::ProcMacro => "proc-macro".to_string(), - TargetKind::RLib => "rlib".to_string(), - TargetKind::StaticLib => "staticlib".to_string(), - TargetKind::Test => "test".to_string(), - TargetKind::Unknown(s) => s, - _ => panic!( - "unknown target kind {tk:?} -- this impl should have been \ - replaced with https://github.com/oli-obk/cargo_metadata/issues/275" - ), - } -} - struct DependencyResolver<'g> { from_id: &'g PackageId,