Bump cargo_metadata

This commit is contained in:
Laurențiu Nicola 2022-07-03 10:08:10 +03:00
parent 2d3f0b4841
commit 9e7ca80c82
5 changed files with 14 additions and 9 deletions

4
Cargo.lock generated
View File

@ -132,9 +132,9 @@ dependencies = [
[[package]]
name = "cargo_metadata"
version = "0.14.2"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa"
checksum = "3abb7553d5b9b8421c6de7cb02606ff15e0c6eea7d8eadd75ef013fd636bec36"
dependencies = [
"camino",
"cargo-platform",

View File

@ -12,7 +12,7 @@ doctest = false
[dependencies]
crossbeam-channel = "0.5.5"
tracing = "0.1.35"
cargo_metadata = "0.14.2"
cargo_metadata = "0.15.0"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"
jod-thread = "0.1.2"

View File

@ -12,4 +12,4 @@ doctest = false
[build-dependencies]
proc-macro-test-impl = { path = "imp", version = "0.0.0" }
toolchain = { path = "../toolchain", version = "0.0.0" }
cargo_metadata = "0.14.2"
cargo_metadata = "0.15.0"

View File

@ -12,7 +12,7 @@ doctest = false
[dependencies]
tracing = "0.1.35"
rustc-hash = "1.1.0"
cargo_metadata = "0.14.2"
cargo_metadata = "0.15.0"
semver = "1.0.10"
serde = { version = "1.0.137", features = ["derive"] }
serde_json = "1.0.81"

View File

@ -318,10 +318,15 @@ pub fn new(mut meta: cargo_metadata::Metadata) -> CargoWorkspace {
..
} = meta_pkg;
let meta = from_value::<PackageMetadata>(metadata.clone()).unwrap_or_default();
let edition = edition.parse::<Edition>().unwrap_or_else(|err| {
tracing::error!("Failed to parse edition {}", err);
Edition::CURRENT
});
let edition = match edition {
cargo_metadata::Edition::E2015 => Edition::Edition2015,
cargo_metadata::Edition::E2018 => Edition::Edition2018,
cargo_metadata::Edition::E2021 => Edition::Edition2021,
_ => {
tracing::error!("Unsupported edition `{:?}`", edition);
Edition::CURRENT
}
};
// We treat packages without source as "local" packages. That includes all members of
// the current workspace, as well as any path dependency outside the workspace.
let is_local = meta_pkg.source.is_none();