diff --git a/Cargo.lock b/Cargo.lock index 39a2a936..676e6cb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,19 +81,18 @@ checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da" [[package]] name = "cargo" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca7e53bf83eb8f6254a37ac45822003c05f6053c09b58795de76a3d6c84eda8a" +checksum = "6cbd976a733418564685769d03cca35bf228ddfc2c8a5e6771ca0f48ce80ae2e" dependencies = [ "anyhow", "atty", "bytesize", "cargo-platform", + "cargo-util", "clap", - "core-foundation", "crates-io", "crossbeam-utils", - "crypto-hash", "curl", "curl-sys", "env_logger", @@ -115,14 +114,12 @@ dependencies = [ "libgit2-sys", "log", "memchr", - "miow", "num_cpus", "opener", "percent-encoding", "rand", "rustc-workspace-hack", "rustfix", - "same-file", "semver", "serde", "serde_ignored", @@ -149,6 +146,28 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-util" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c5259672ff02c8c4d291fb52c9e6936d97dbfacea8d7011a0621aaaaab4c28" +dependencies = [ + "anyhow", + "core-foundation", + "crypto-hash", + "filetime", + "hex 0.4.2", + "jobserver", + "libc", + "log", + "miow", + "same-file", + "shell-escape", + "tempfile", + "walkdir", + "winapi", +] + [[package]] name = "cc" version = "1.0.61" diff --git a/Cargo.toml b/Cargo.toml index ce9ba6c4..8d7ee62b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license-file = "LICENSE" edition = "2018" [dependencies] -cargo = "0.53" +cargo = "0.54" crates-io = "0.33" # Keep in sync with version pulled by Cargo curl = "0.4.38" env_logger = "0.8" diff --git a/src/bin/cargo-semver.rs b/src/bin/cargo-semver.rs index cd1432b7..af4bba75 100644 --- a/src/bin/cargo-semver.rs +++ b/src/bin/cargo-semver.rs @@ -3,8 +3,9 @@ extern crate rustc_session; -use cargo::core::{Package, PackageId, Source, SourceId, Workspace}; +use cargo::core::{FeatureValue, Package, PackageId, Source, SourceId, Workspace}; use cargo::sources::RegistrySource; +use cargo::util::interning::InternedString; use curl::easy::Easy; use log::debug; use rustc_session::getopts; @@ -15,6 +16,7 @@ use std::{ io::Write, path::{Path, PathBuf}, process::{Command, Stdio}, + rc::Rc, sync::{Arc, RwLock}, }; @@ -491,11 +493,16 @@ impl<'a> WorkInfo<'a> { }; if let Some(s) = matches.opt_str("features") { - opts.features = s.split(' ').map(str::to_owned).collect(); + opts.cli_features.features = Rc::new( + s.split(' ') + .map(InternedString::new) + .map(|f| FeatureValue::new(f)) + .collect(), + ); } - opts.all_features = matches.opt_present("all-features"); - opts.no_default_features = matches.opt_present("no-default-features"); + opts.cli_features.all_features = matches.opt_present("all-features"); + opts.cli_features.uses_default_features = !matches.opt_present("no-default-features"); env::set_var( "RUSTFLAGS",