diff -Nru cargo-0.58.0/benches/benchsuite/benches/resolve.rs cargo-0.60.0ubuntu1/benches/benchsuite/benches/resolve.rs
--- cargo-0.58.0/benches/benchsuite/benches/resolve.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/benches/benchsuite/benches/resolve.rs 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,327 @@
+use cargo::core::compiler::{CompileKind, RustcTargetData};
+use cargo::core::resolver::features::{CliFeatures, FeatureOpts, FeatureResolver, ForceAllTargets};
+use cargo::core::resolver::{HasDevUnits, ResolveBehavior};
+use cargo::core::{PackageIdSpec, Workspace};
+use cargo::ops::WorkspaceResolve;
+use cargo::Config;
+use criterion::{criterion_group, criterion_main, Criterion};
+use std::fs;
+use std::path::{Path, PathBuf};
+use std::process::Command;
+use url::Url;
+
+// This is an arbitrary commit that existed when I started. This helps
+// ensure consistent results. It can be updated if needed, but that can
+// make it harder to compare results with older versions of cargo.
+const CRATES_IO_COMMIT: &str = "85f7bfd61ea4fee08ec68c468762e886b2aebec6";
+
+fn setup() {
+ create_home();
+ create_target_dir();
+ clone_index();
+ unpack_workspaces();
+}
+
+fn root() -> PathBuf {
+ let mut p = PathBuf::from(env!("CARGO_TARGET_TMPDIR"));
+ p.push("bench");
+ p
+}
+
+fn target_dir() -> PathBuf {
+ let mut p = root();
+ p.push("target");
+ p
+}
+
+fn cargo_home() -> PathBuf {
+ let mut p = root();
+ p.push("chome");
+ p
+}
+
+fn index() -> PathBuf {
+ let mut p = root();
+ p.push("index");
+ p
+}
+
+fn workspaces_path() -> PathBuf {
+ let mut p = root();
+ p.push("workspaces");
+ p
+}
+
+fn registry_url() -> Url {
+ Url::from_file_path(index()).unwrap()
+}
+
+fn create_home() {
+ let home = cargo_home();
+ if !home.exists() {
+ fs::create_dir_all(&home).unwrap();
+ }
+ fs::write(
+ home.join("config.toml"),
+ format!(
+ r#"
+ [source.crates-io]
+ replace-with = 'local-snapshot'
+
+ [source.local-snapshot]
+ registry = '{}'
+ "#,
+ registry_url()
+ ),
+ )
+ .unwrap();
+}
+
+fn create_target_dir() {
+ // This is necessary to ensure the .rustc_info.json file is written.
+ // Otherwise it won't be written, and it is very expensive to create.
+ if !target_dir().exists() {
+ std::fs::create_dir_all(target_dir()).unwrap();
+ }
+}
+
+/// This clones crates.io at a specific point in time into tmp/index.
+fn clone_index() {
+ let index = index();
+ let maybe_git = |command: &str| {
+ let status = Command::new("git")
+ .current_dir(&index)
+ .args(command.split_whitespace().collect::>())
+ .status()
+ .expect("git should be installed");
+ status.success()
+ };
+ let git = |command: &str| {
+ if !maybe_git(command) {
+ panic!("failed to run git command: {}", command);
+ }
+ };
+ if index.exists() {
+ if maybe_git(&format!(
+ "rev-parse -q --verify {}^{{commit}}",
+ CRATES_IO_COMMIT
+ )) {
+ // Already fetched.
+ return;
+ }
+ } else {
+ fs::create_dir_all(&index).unwrap();
+ git("init --bare");
+ git("remote add origin https://github.com/rust-lang/crates.io-index");
+ }
+ git(&format!("fetch origin {}", CRATES_IO_COMMIT));
+ git("branch -f master FETCH_HEAD");
+}
+
+/// This unpacks the compressed workspace skeletons into tmp/workspaces.
+fn unpack_workspaces() {
+ let ws_dir = Path::new(env!("CARGO_MANIFEST_DIR"))
+ .parent()
+ .unwrap()
+ .join("workspaces");
+ let archives = fs::read_dir(ws_dir)
+ .unwrap()
+ .map(|e| e.unwrap().path())
+ .filter(|p| p.extension() == Some(std::ffi::OsStr::new("tgz")));
+ for archive in archives {
+ let name = archive.file_stem().unwrap();
+ let f = fs::File::open(&archive).unwrap();
+ let f = flate2::read::GzDecoder::new(f);
+ let dest = workspaces_path().join(&name);
+ if dest.exists() {
+ fs::remove_dir_all(&dest).unwrap();
+ }
+ let mut archive = tar::Archive::new(f);
+ archive.unpack(workspaces_path()).unwrap();
+ }
+}
+
+struct ResolveInfo<'cfg> {
+ ws: Workspace<'cfg>,
+ requested_kinds: [CompileKind; 1],
+ target_data: RustcTargetData<'cfg>,
+ cli_features: CliFeatures,
+ specs: Vec,
+ has_dev_units: HasDevUnits,
+ force_all_targets: ForceAllTargets,
+ ws_resolve: WorkspaceResolve<'cfg>,
+}
+
+/// Vec of `(ws_name, ws_root)`.
+fn workspaces() -> Vec<(String, PathBuf)> {
+ // CARGO_BENCH_WORKSPACES can be used to override, otherwise it just uses
+ // the workspaces in the workspaces directory.
+ let mut ps: Vec<_> = match std::env::var_os("CARGO_BENCH_WORKSPACES") {
+ Some(s) => std::env::split_paths(&s).collect(),
+ None => fs::read_dir(workspaces_path())
+ .unwrap()
+ .map(|e| e.unwrap().path())
+ // These currently fail in most cases on Windows due to long
+ // filenames in the git checkouts.
+ .filter(|p| {
+ !(cfg!(windows)
+ && matches!(p.file_name().unwrap().to_str().unwrap(), "servo" | "tikv"))
+ })
+ .collect(),
+ };
+ // Sort so it is consistent.
+ ps.sort();
+ ps.into_iter()
+ .map(|p| (p.file_name().unwrap().to_str().unwrap().to_owned(), p))
+ .collect()
+}
+
+/// Helper for resolving a workspace. This will run the resolver once to
+/// download everything, and returns all the data structures that are used
+/// during resolution.
+fn do_resolve<'cfg>(config: &'cfg Config, ws_root: &Path) -> ResolveInfo<'cfg> {
+ let requested_kinds = [CompileKind::Host];
+ let ws = cargo::core::Workspace::new(&ws_root.join("Cargo.toml"), config).unwrap();
+ let target_data = RustcTargetData::new(&ws, &requested_kinds).unwrap();
+ let cli_features = CliFeatures::from_command_line(&[], false, true).unwrap();
+ let pkgs = cargo::ops::Packages::Default;
+ let specs = pkgs.to_package_id_specs(&ws).unwrap();
+ let has_dev_units = HasDevUnits::Yes;
+ let force_all_targets = ForceAllTargets::No;
+ // Do an initial run to download anything necessary so that it does
+ // not confuse criterion's warmup.
+ let ws_resolve = cargo::ops::resolve_ws_with_opts(
+ &ws,
+ &target_data,
+ &requested_kinds,
+ &cli_features,
+ &specs,
+ has_dev_units,
+ force_all_targets,
+ )
+ .unwrap();
+ ResolveInfo {
+ ws,
+ requested_kinds,
+ target_data,
+ cli_features,
+ specs,
+ has_dev_units,
+ force_all_targets,
+ ws_resolve,
+ }
+}
+
+/// Creates a new Config.
+///
+/// This is separate from `do_resolve` to deal with the ownership and lifetime.
+fn make_config(ws_root: &Path) -> Config {
+ let shell = cargo::core::Shell::new();
+ let mut config = cargo::util::Config::new(shell, ws_root.to_path_buf(), cargo_home());
+ // Configure is needed to set the target_dir which is needed to write
+ // the .rustc_info.json file which is very expensive.
+ config
+ .configure(
+ 0,
+ false,
+ None,
+ false,
+ false,
+ false,
+ &Some(target_dir()),
+ &[],
+ &[],
+ )
+ .unwrap();
+ config
+}
+
+/// Benchmark of the full `resovle_ws_with_opts` which runs the resolver
+/// twice, the feature resolver, and more. This is a major component of a
+/// regular cargo build.
+fn resolve_ws(c: &mut Criterion) {
+ setup();
+ let mut group = c.benchmark_group("resolve_ws");
+ for (ws_name, ws_root) in workspaces() {
+ let config = make_config(&ws_root);
+ // The resolver info is initialized only once in a lazy fashion. This
+ // allows criterion to skip this workspace if the user passes a filter
+ // on the command-line (like `cargo bench -- resolve_ws/tikv`).
+ //
+ // Due to the way criterion works, it tends to only run the inner
+ // iterator once, and we don't want to call `do_resolve` in every
+ // "step", since that would just be some useless work.
+ let mut lazy_info = None;
+ group.bench_function(&ws_name, |b| {
+ let ResolveInfo {
+ ws,
+ requested_kinds,
+ target_data,
+ cli_features,
+ specs,
+ has_dev_units,
+ force_all_targets,
+ ..
+ } = lazy_info.get_or_insert_with(|| do_resolve(&config, &ws_root));
+ b.iter(|| {
+ cargo::ops::resolve_ws_with_opts(
+ ws,
+ target_data,
+ requested_kinds,
+ cli_features,
+ specs,
+ *has_dev_units,
+ *force_all_targets,
+ )
+ .unwrap();
+ })
+ });
+ }
+ group.finish();
+}
+
+/// Benchmark of the feature resolver.
+fn feature_resolver(c: &mut Criterion) {
+ setup();
+ let mut group = c.benchmark_group("feature_resolver");
+ for (ws_name, ws_root) in workspaces() {
+ let config = make_config(&ws_root);
+ let mut lazy_info = None;
+ group.bench_function(&ws_name, |b| {
+ let ResolveInfo {
+ ws,
+ requested_kinds,
+ target_data,
+ cli_features,
+ specs,
+ has_dev_units,
+ ws_resolve,
+ ..
+ } = lazy_info.get_or_insert_with(|| do_resolve(&config, &ws_root));
+ b.iter(|| {
+ let feature_opts = FeatureOpts::new_behavior(ResolveBehavior::V2, *has_dev_units);
+ FeatureResolver::resolve(
+ ws,
+ target_data,
+ &ws_resolve.targeted_resolve,
+ &ws_resolve.pkg_set,
+ cli_features,
+ specs,
+ requested_kinds,
+ feature_opts,
+ )
+ .unwrap();
+ })
+ });
+ }
+ group.finish();
+}
+
+// Criterion complains about the measurement time being too small, but the
+// measurement time doesn't seem important to me, what is more important is
+// the number of iterations which defaults to 100, which seems like a
+// reasonable default. Otherwise, the measurement time would need to be
+// changed per workspace. We wouldn't want to spend 60s on every workspace,
+// that would take too long and isn't necessary for the smaller workspaces.
+criterion_group!(benches, resolve_ws, feature_resolver);
+criterion_main!(benches);
diff -Nru cargo-0.58.0/benches/benchsuite/Cargo.toml cargo-0.60.0ubuntu1/benches/benchsuite/Cargo.toml
--- cargo-0.58.0/benches/benchsuite/Cargo.toml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/benches/benchsuite/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,21 @@
+[package]
+name = "benchsuite"
+version = "0.1.0"
+edition = "2021"
+license = "MIT OR Apache-2.0"
+homepage = "https://github.com/rust-lang/cargo"
+repository = "https://github.com/rust-lang/cargo"
+documentation = "https://docs.rs/cargo-platform"
+description = "Benchmarking suite for Cargo."
+
+[dependencies]
+cargo = { path = "../.." }
+# Consider removing html_reports in 0.4 and switching to `cargo criterion`.
+criterion = { version = "0.3.5", features = ["html_reports"] }
+flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
+tar = { version = "0.4.35", default-features = false }
+url = "2.2.2"
+
+[[bench]]
+name = "resolve"
+harness = false
diff -Nru cargo-0.58.0/benches/capture/Cargo.toml cargo-0.60.0ubuntu1/benches/capture/Cargo.toml
--- cargo-0.58.0/benches/capture/Cargo.toml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/benches/capture/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,12 @@
+[package]
+name = "capture"
+version = "0.1.0"
+edition = "2021"
+license = "MIT OR Apache-2.0"
+description = "Tool for capturing a real-world workspace for benchmarking."
+
+[dependencies]
+cargo_metadata = "0.14.0"
+flate2 = { version = "1.0.3", default-features = false, features = ["zlib"] }
+tar = { version = "0.4.35", default-features = false }
+toml = "0.5.8"
diff -Nru cargo-0.58.0/benches/capture/src/main.rs cargo-0.60.0ubuntu1/benches/capture/src/main.rs
--- cargo-0.58.0/benches/capture/src/main.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/benches/capture/src/main.rs 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,164 @@
+//! This tool helps to capture the `Cargo.toml` files of a workspace.
+//!
+//! Run it by passing a list of workspaces to capture.
+//! Use the `-f` flag to allow it to overwrite existing captures.
+//! The workspace will be saved in a `.tgz` file in the `../workspaces` directory.
+
+use flate2::{Compression, GzBuilder};
+use std::fs;
+use std::path::{Path, PathBuf};
+use std::process::Command;
+
+fn main() {
+ let force = std::env::args().any(|arg| arg == "-f");
+ let dest = Path::new(env!("CARGO_MANIFEST_DIR"))
+ .parent()
+ .unwrap()
+ .join("workspaces");
+ if !dest.exists() {
+ panic!("expected {} to exist", dest.display());
+ }
+ for arg in std::env::args().skip(1).filter(|arg| !arg.starts_with("-")) {
+ let source_root = fs::canonicalize(arg).unwrap();
+ capture(&source_root, &dest, force);
+ }
+}
+
+fn capture(source_root: &Path, dest: &Path, force: bool) {
+ let name = Path::new(source_root.file_name().unwrap());
+ let mut dest_gz = PathBuf::from(dest);
+ dest_gz.push(name);
+ dest_gz.set_extension("tgz");
+ if dest_gz.exists() {
+ if !force {
+ panic!(
+ "dest {:?} already exists, use -f to force overwriting",
+ dest_gz
+ );
+ }
+ fs::remove_file(&dest_gz).unwrap();
+ }
+ let vcs_info = capture_vcs_info(source_root, force);
+ let dst = fs::File::create(&dest_gz).unwrap();
+ let encoder = GzBuilder::new()
+ .filename(format!("{}.tar", name.to_str().unwrap()))
+ .write(dst, Compression::best());
+ let mut ar = tar::Builder::new(encoder);
+ ar.mode(tar::HeaderMode::Deterministic);
+ if let Some(info) = &vcs_info {
+ add_ar_file(&mut ar, &name.join(".cargo_vcs_info.json"), info);
+ }
+
+ // Gather all local packages.
+ let metadata = cargo_metadata::MetadataCommand::new()
+ .manifest_path(source_root.join("Cargo.toml"))
+ .features(cargo_metadata::CargoOpt::AllFeatures)
+ .exec()
+ .expect("cargo_metadata failed");
+ let mut found_root = false;
+ for package in &metadata.packages {
+ if package.source.is_some() {
+ continue;
+ }
+ let manifest_path = package.manifest_path.as_std_path();
+ copy_manifest(&manifest_path, &mut ar, name, &source_root);
+ found_root |= manifest_path == source_root.join("Cargo.toml");
+ }
+ if !found_root {
+ // A virtual workspace.
+ let contents = fs::read_to_string(source_root.join("Cargo.toml")).unwrap();
+ assert!(!contents.contains("[package]"));
+ add_ar_file(&mut ar, &name.join("Cargo.toml"), &contents);
+ }
+ let lock = fs::read_to_string(source_root.join("Cargo.lock")).unwrap();
+ add_ar_file(&mut ar, &name.join("Cargo.lock"), &lock);
+ let encoder = ar.into_inner().unwrap();
+ encoder.finish().unwrap();
+ eprintln!("created {}", dest_gz.display());
+}
+
+fn copy_manifest(
+ manifest_path: &Path,
+ ar: &mut tar::Builder,
+ name: &Path,
+ source_root: &Path,
+) {
+ let relative_path = manifest_path
+ .parent()
+ .unwrap()
+ .strip_prefix(source_root)
+ .expect("workspace member should be under workspace root");
+ let relative_path = name.join(relative_path);
+ let contents = fs::read_to_string(&manifest_path).unwrap();
+ let mut manifest: toml::Value = toml::from_str(&contents).unwrap();
+ let remove = |obj: &mut toml::Value, name| {
+ let table = obj.as_table_mut().unwrap();
+ if table.contains_key(name) {
+ table.remove(name);
+ }
+ };
+ remove(&mut manifest, "lib");
+ remove(&mut manifest, "bin");
+ remove(&mut manifest, "example");
+ remove(&mut manifest, "test");
+ remove(&mut manifest, "bench");
+ remove(&mut manifest, "profile");
+ if let Some(package) = manifest.get_mut("package") {
+ remove(package, "default-run");
+ }
+ let contents = toml::to_string(&manifest).unwrap();
+ add_ar_file(ar, &relative_path.join("Cargo.toml"), &contents);
+ add_ar_file(ar, &relative_path.join("src").join("lib.rs"), "");
+}
+
+fn add_ar_file(ar: &mut tar::Builder, path: &Path, contents: &str) {
+ let mut header = tar::Header::new_gnu();
+ header.set_entry_type(tar::EntryType::file());
+ header.set_mode(0o644);
+ header.set_size(contents.len() as u64);
+ header.set_mtime(123456789);
+ header.set_cksum();
+ ar.append_data(&mut header, path, contents.as_bytes())
+ .unwrap();
+}
+
+fn capture_vcs_info(ws_root: &Path, force: bool) -> Option {
+ let maybe_git = |command: &str| {
+ Command::new("git")
+ .current_dir(ws_root)
+ .args(command.split_whitespace().collect::>())
+ .output()
+ .expect("git should be installed")
+ };
+ assert!(ws_root.join("Cargo.toml").exists());
+ let relative = maybe_git("ls-files --full-name Cargo.toml");
+ if !relative.status.success() {
+ if !force {
+ panic!("git repository not detected, use -f to force");
+ }
+ return None;
+ }
+ let p = Path::new(std::str::from_utf8(&relative.stdout).unwrap().trim());
+ let relative = p.parent().unwrap();
+ if !force {
+ let has_changes = !maybe_git("diff-index --quiet HEAD .").status.success();
+ if has_changes {
+ panic!("git repo appears to have changes, use -f to force, or clean the repo");
+ }
+ }
+ let commit = maybe_git("rev-parse HEAD");
+ assert!(commit.status.success());
+ let commit = std::str::from_utf8(&commit.stdout).unwrap().trim();
+ let remote = maybe_git("remote get-url origin");
+ assert!(remote.status.success());
+ let remote = std::str::from_utf8(&remote.stdout).unwrap().trim();
+ let info = format!(
+ "{{\n \"git\": {{\n \"sha1\": \"{}\",\n \"remote\": \"{}\"\n }},\
+ \n \"path_in_vcs\": \"{}\"\n}}\n",
+ commit,
+ remote,
+ relative.display()
+ );
+ eprintln!("recording vcs info:\n{}", info);
+ Some(info)
+}
diff -Nru cargo-0.58.0/benches/README.md cargo-0.60.0ubuntu1/benches/README.md
--- cargo-0.58.0/benches/README.md 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/benches/README.md 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,124 @@
+# Cargo Benchmarking
+
+This directory contains some benchmarks for cargo itself. This uses
+[Criterion] for running benchmarks. It is recommended to read the Criterion
+book to get familiar with how to use it. A basic usage would be:
+
+```sh
+cd benches/benchsuite
+cargo bench
+```
+
+The tests involve downloading the index and benchmarking against some
+real-world and artificial workspaces located in the [`workspaces`](workspaces)
+directory.
+
+**Beware** that the initial download can take a fairly long amount of time (10
+minutes minimum on an extremely fast network) and require significant disk
+space (around 4.5GB). The benchsuite will cache the index and downloaded
+crates in the `target/tmp/bench` directory, so subsequent runs should be
+faster. You can (and probably should) specify individual benchmarks to run to
+narrow it down to a more reasonable set, for example:
+
+```sh
+cargo bench -- resolve_ws/rust
+```
+
+This will only download what's necessary for the rust-lang/rust workspace
+(which is about 330MB) and run the benchmarks against it (which should take
+about a minute). To get a list of all the benchmarks, run:
+
+```sh
+cargo bench -- --list
+```
+
+## Viewing reports
+
+The benchmarks display some basic information on the command-line while they
+run. A more complete HTML report can be found at
+`target/criterion/report/index.html` which contains links to all the
+benchmarks and summaries. Check out the Criterion book for more information on
+the extensive reporting capabilities.
+
+## Comparing implementations
+
+Knowing the raw numbers can be useful, but what you're probably most
+interested in is checking if your changes help or hurt performance. To do
+that, you need to run the benchmarks multiple times.
+
+First, run the benchmarks from the master branch of cargo without any changes.
+To make it easier to compare, Criterion supports naming the baseline so that
+you can iterate on your code and compare against it multiple times.
+
+```sh
+cargo bench -- --save-baseline master
+```
+
+Now you can switch to your branch with your changes. Re-run the benchmarks
+compared against the baseline:
+
+```sh
+cargo bench -- --baseline master
+```
+
+You can repeat the last command as you make changes to re-compare against the
+master baseline.
+
+Without the baseline arguments, it will compare against the last run, which
+can be helpful for comparing incremental changes.
+
+## Capturing workspaces
+
+The [`workspaces`](workspaces) directory contains several workspaces that
+provide a variety of different workspaces intended to provide good exercises
+for benchmarks. Some of these are shadow copies of real-world workspaces. This
+is done with the tool in the [`capture`](capture) directory. The tool will
+copy `Cargo.lock` and all of the `Cargo.toml` files of the workspace members.
+It also adds an empty `lib.rs` so Cargo won't error, and sanitizes the
+`Cargo.toml` to some degree, removing unwanted elements. Finally, it
+compresses everything into a `tgz`.
+
+To run it, do:
+
+```sh
+cd benches/capture
+cargo run -- /path/to/workspace/foo
+```
+
+The resolver benchmarks also support the `CARGO_BENCH_WORKSPACES` environment
+variable, which you can point to a Cargo workspace if you want to try
+different workspaces. For example:
+
+```sh
+CARGO_BENCH_WORKSPACES=/path/to/some/workspace cargo bench
+```
+
+## TODO
+
+This is just a start for establishing a benchmarking suite for Cargo. There's
+a lot that can be added. Some ideas:
+
+* Fix the benchmarks so that the resolver setup doesn't run every iteration.
+* Benchmark [this section of
+ code](https://github.com/rust-lang/cargo/blob/a821e2cb24d7b6013433f069ab3bad53d160e100/src/cargo/ops/cargo_compile.rs#L470-L549)
+ which builds the unit graph. The performance there isn't great, and it would
+ be good to keep an eye on it. Unfortunately that would mean doing a bit of
+ work to make `generate_targets` publicly visible, and there is a bunch of
+ setup code that may need to be duplicated.
+* Benchmark the fingerprinting code.
+* Benchmark running the `cargo` executable. Running something like `cargo
+ build` or `cargo check` with everything "Fresh" would be a good end-to-end
+ exercise to measure the overall overhead of Cargo.
+* Benchmark pathological resolver scenarios. There might be some cases where
+ the resolver can spend a significant amount of time. It would be good to
+ identify if these exist, and create benchmarks for them. This may require
+ creating an artificial index, similar to the `resolver-tests`. This should
+ also consider scenarios where the resolver ultimately fails.
+* Benchmark without `Cargo.lock`. I'm not sure if this is particularly
+ valuable, since we are mostly concerned with incremental builds which will
+ always have a lock file.
+* Benchmark just
+ [`resolve::resolve`](https://github.com/rust-lang/cargo/blob/a821e2cb24d7b6013433f069ab3bad53d160e100/src/cargo/core/resolver/mod.rs#L122)
+ without anything else. This can help focus on just the resolver.
+
+[Criterion]: https://bheisler.github.io/criterion.rs/book/
diff -Nru cargo-0.58.0/Cargo.toml cargo-0.60.0ubuntu1/Cargo.toml
--- cargo-0.58.0/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,10 +1,7 @@
[package]
name = "cargo"
-version = "0.58.0"
-edition = "2018"
-authors = ["Yehuda Katz ",
- "Carl Lerche ",
- "Alex Crichton "]
+version = "0.60.0"
+edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://crates.io"
repository = "https://github.com/rust-lang/cargo"
@@ -22,11 +19,11 @@
atty = "0.2"
bytesize = "1.0"
cargo-platform = { path = "crates/cargo-platform", version = "0.1.2" }
-cargo-util = { path = "crates/cargo-util", version = "0.1.1" }
-crates-io = { path = "crates/crates-io", version = "0.33.0" }
+cargo-util = { path = "crates/cargo-util", version = "0.1.2" }
+crates-io = { path = "crates/crates-io", version = "0.33.1" }
crossbeam-utils = "0.8"
-curl = { version = "0.4.39", features = ["http2"] }
-curl-sys = "0.4.49"
+curl = { version = "0.4.41", features = ["http2"] }
+curl-sys = "0.4.50"
env_logger = "0.9.0"
pretty_env_logger = { version = "0.4", optional = true }
anyhow = "1.0"
@@ -57,14 +54,14 @@
serde_json = { version = "1.0.30", features = ["raw_value"] }
shell-escape = "0.1.4"
strip-ansi-escapes = "0.1.0"
-tar = { version = "0.4.35", default-features = false }
+tar = { version = "0.4.36", default-features = false }
tempfile = "3.0"
termcolor = "1.1"
toml = "0.5.7"
unicode-xid = "0.2.0"
url = "2.2.2"
walkdir = "2.2"
-clap = "2.31.2"
+clap = "2.34.0"
unicode-width = "0.1.5"
openssl = { version = '0.10.11', optional = true }
im-rc = "15.0.0"
diff -Nru cargo-0.58.0/CHANGELOG.md cargo-0.60.0ubuntu1/CHANGELOG.md
--- cargo-0.58.0/CHANGELOG.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/CHANGELOG.md 2022-02-10 02:58:21.000000000 +0000
@@ -1,21 +1,118 @@
# Changelog
+## Cargo 1.59 (2022-02-24)
+[7f08ace4...HEAD](https://github.com/rust-lang/cargo/compare/7f08ace4...HEAD)
+
+### Added
+
+### Changed
+
+### Fixed
+
+### Nightly only
+- Added the `--crate-type` flag to `cargo rustc`.
+ [#10093](https://github.com/rust-lang/cargo/pull/10093)
+
+
+## Cargo 1.58 (2022-01-13)
+[b2e52d7c...rust-1.58.0](https://github.com/rust-lang/cargo/compare/b2e52d7c...rust-1.58.0)
+
+### Added
+
+- Added `rust_version` field to package data in `cargo metadata`.
+ [#9967](https://github.com/rust-lang/cargo/pull/9967)
+- Added `--message-format` option to `cargo install`.
+ [#10107](https://github.com/rust-lang/cargo/pull/10107)
+
+### Changed
+
+- A warning is now shown when an alias shadows an external command.
+ [#10082](https://github.com/rust-lang/cargo/pull/10082)
+- Updated curl to 7.80.0.
+ [#10040](https://github.com/rust-lang/cargo/pull/10040)
+ [#10106](https://github.com/rust-lang/cargo/pull/10106)
+
+### Fixed
+
+- Doctests now include rustc-link-args from build scripts.
+ [#9916](https://github.com/rust-lang/cargo/pull/9916)
+- Fixed `cargo tree` entering an infinite loop with cyclical dev-dependencies.
+ Fixed an edge case where the resolver would fail to handle a cyclical dev-dependency with a feature.
+ [#10103](https://github.com/rust-lang/cargo/pull/10103)
+- Fixed `cargo clean -p` when the directory path contains glob characters.
+ [#10072](https://github.com/rust-lang/cargo/pull/10072)
+- Fixed debug builds of `cargo` which could panic when downloading a crate
+ when the server has a redirect with a non-empty body.
+ [#10048](https://github.com/rust-lang/cargo/pull/10048)
+
+### Nightly only
+
+- Make future-incompat-report output more user-friendly.
+ [#9953](https://github.com/rust-lang/cargo/pull/9953)
+- Added support to scrape code examples from the `examples` directory to be included in the documentation.
+ [docs](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#scrape-examples)
+ [#9525](https://github.com/rust-lang/cargo/pull/9525)
+ [#10037](https://github.com/rust-lang/cargo/pull/10037)
+ [#10017](https://github.com/rust-lang/cargo/pull/10017)
+- Fixed `cargo report future-incompatibilities` to check stdout if it supports color.
+ [#10024](https://github.com/rust-lang/cargo/pull/10024)
+
## Cargo 1.57 (2021-12-02)
-[18751dd3...HEAD](https://github.com/rust-lang/cargo/compare/18751dd3...HEAD)
+[18751dd3...rust-1.57.0](https://github.com/rust-lang/cargo/compare/18751dd3...rust-1.57.0)
### Added
+- 🎉 Added custom named profiles. This also changes the `test` and `bench`
+ profiles to inherit their settings from `dev` and `release`, and Cargo will
+ now only use a single profile during a given command instead of using
+ different profiles for dependencies and cargo-targets.
+ [docs](https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#custom-profiles)
+ [#9943](https://github.com/rust-lang/cargo/pull/9943)
- The `rev` option for a git dependency now supports git references that start
with `refs/`. An example where this can be used is to depend on a pull
request from a service like GitHub before it is merged.
[#9859](https://github.com/rust-lang/cargo/pull/9859)
+- Added `path_in_vcs` field to the `.cargo_vcs_info.json` file.
+ [docs](https://doc.rust-lang.org/nightly/cargo/commands/cargo-package.html#cargo_vcs_infojson-format)
+ [#9866](https://github.com/rust-lang/cargo/pull/9866)
### Changed
+- ❗ `RUSTFLAGS` is no longer set for build scripts. This change was made in
+ 1.55, but the release notes did not highlight this change. Build scripts
+ should use `CARGO_ENCODED_RUSTFLAGS` instead. See the
+ [documentation](https://doc.rust-lang.org/nightly/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
+ for more details.
+- The `cargo version` command now includes some extra information.
+ [#9968](https://github.com/rust-lang/cargo/pull/9968)
+- Updated libgit2 to 1.3 which brings in a number of fixes and changes to git
+ handling.
+ [#9963](https://github.com/rust-lang/cargo/pull/9963)
+ [#9988](https://github.com/rust-lang/cargo/pull/9988)
+- Shell completions now include shorthand b/r/c/d subcommands.
+ [#9951](https://github.com/rust-lang/cargo/pull/9951)
+- `cargo update --precise` now allows specifying a version without semver
+ metadata (stuff after `+` in the version number).
+ [#9945](https://github.com/rust-lang/cargo/pull/9945)
+- zsh completions now complete `--example` names.
+ [#9939](https://github.com/rust-lang/cargo/pull/9939)
+- The progress bar now differentiates when building unittests.
+ [#9934](https://github.com/rust-lang/cargo/pull/9934)
+- Some backwards-compatibility support for invalid TOML syntax has been removed.
+ [#9932](https://github.com/rust-lang/cargo/pull/9932)
+- Reverted the change from 1.55 that triggered an error for dependency
+ specifications that did not include any fields.
+ [#9911](https://github.com/rust-lang/cargo/pull/9911)
+
### Fixed
- Removed a log message (from `CARGO_LOG`) that may leak tokens.
[#9873](https://github.com/rust-lang/cargo/pull/9873)
+- `cargo fix` will now avoid writing fixes to the global registry cache.
+ [#9938](https://github.com/rust-lang/cargo/pull/9938)
+- Fixed `-Z help` CLI option when used with a shorthand alias (b/c/r/d).
+ [#9933](https://github.com/rust-lang/cargo/pull/9933)
+
### Nightly only
@@ -105,6 +202,8 @@
[#9818](https://github.com/rust-lang/cargo/pull/9818)
- Return an error instead of a stack overflow for command alias loops.
[#9791](https://github.com/rust-lang/cargo/pull/9791)
+- Updated to curl 7.79.1, which will hopefully fix intermittent http2 errors.
+ [#9937](https://github.com/rust-lang/cargo/pull/9937)
### Nightly only
@@ -129,8 +228,10 @@
- The package definition in `cargo metadata` now includes the `"default_run"`
field from the manifest.
[#9550](https://github.com/rust-lang/cargo/pull/9550)
-- Build scripts now have access to the following environment variables:
+- ❗ Build scripts now have access to the following environment variables:
`RUSTC_WRAPPER`, `RUSTC_WORKSPACE_WRAPPER`, `CARGO_ENCODED_RUSTFLAGS`.
+ `RUSTFLAGS` is no longer set for build scripts; they should use
+ `CARGO_ENCODED_RUSTFLAGS` instead.
[docs](https://doc.rust-lang.org/nightly/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts)
[#9601](https://github.com/rust-lang/cargo/pull/9601)
- Added `cargo d` as an alias for `cargo doc`.
diff -Nru cargo-0.58.0/crates/cargo-platform/Cargo.toml cargo-0.60.0ubuntu1/crates/cargo-platform/Cargo.toml
--- cargo-0.58.0/crates/cargo-platform/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/cargo-platform/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-platform"
version = "0.1.2"
-authors = ["The Cargo Project Developers"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/rust-lang/cargo"
repository = "https://github.com/rust-lang/cargo"
diff -Nru cargo-0.58.0/crates/cargo-test-macro/Cargo.toml cargo-0.60.0ubuntu1/crates/cargo-test-macro/Cargo.toml
--- cargo-0.58.0/crates/cargo-test-macro/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/cargo-test-macro/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-test-macro"
version = "0.1.0"
-authors = ["Jethro Beekman "]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/rust-lang/cargo"
repository = "https://github.com/rust-lang/cargo"
diff -Nru cargo-0.58.0/crates/cargo-test-support/Cargo.toml cargo-0.60.0ubuntu1/crates/cargo-test-support/Cargo.toml
--- cargo-0.58.0/crates/cargo-test-support/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/cargo-test-support/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,9 +1,8 @@
[package]
name = "cargo-test-support"
version = "0.1.0"
-authors = ["Alex Crichton "]
license = "MIT OR Apache-2.0"
-edition = "2018"
+edition = "2021"
[lib]
doctest = false
@@ -24,3 +23,6 @@
termcolor = "1.1.2"
toml = "0.5.7"
url = "2.2.2"
+
+[features]
+deny-warnings = []
diff -Nru cargo-0.58.0/crates/cargo-test-support/src/lib.rs cargo-0.60.0ubuntu1/crates/cargo-test-support/src/lib.rs
--- cargo-0.58.0/crates/cargo-test-support/src/lib.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/cargo-test-support/src/lib.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,6 +5,7 @@
#![allow(clippy::all)]
#![warn(clippy::needless_borrow)]
#![warn(clippy::redundant_clone)]
+#![cfg_attr(feature = "deny-warnings", deny(warnings))]
use std::env;
use std::ffi::OsStr;
@@ -445,6 +446,11 @@
ProjectBuilder::new(paths::root().join("foo"))
}
+// Generates a project layout in given directory
+pub fn project_in(dir: &str) -> ProjectBuilder {
+ ProjectBuilder::new(paths::root().join(dir).join("foo"))
+}
+
// Generates a project layout inside our fake home dir
pub fn project_in_home(name: &str) -> ProjectBuilder {
ProjectBuilder::new(paths::home().join(name))
@@ -797,6 +803,15 @@
}
}
+ #[track_caller]
+ pub fn run_expect_error(&mut self) {
+ self.ran = true;
+ let p = (&self.process_builder).clone().unwrap();
+ if self.match_process(&p).is_ok() {
+ panic!("test was expected to fail, but succeeded running {}", p);
+ }
+ }
+
/// Runs the process, checks the expected output, and returns the first
/// JSON object on stdout.
#[track_caller]
diff -Nru cargo-0.58.0/crates/cargo-util/Cargo.toml cargo-0.60.0ubuntu1/crates/cargo-util/Cargo.toml
--- cargo-0.58.0/crates/cargo-util/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/cargo-util/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-util"
-version = "0.1.1"
-authors = ["The Cargo Project Developers"]
-edition = "2018"
+version = "0.1.2"
+edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/rust-lang/cargo"
repository = "https://github.com/rust-lang/cargo"
diff -Nru cargo-0.58.0/crates/cargo-util/src/paths.rs cargo-0.60.0ubuntu1/crates/cargo-util/src/paths.rs
--- cargo-0.58.0/crates/cargo-util/src/paths.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/cargo-util/src/paths.rs 2022-02-10 02:58:21.000000000 +0000
@@ -123,15 +123,13 @@
});
for candidate in candidates {
if candidate.is_file() {
- // PATH may have a component like "." in it, so we still need to
- // canonicalize.
- return Ok(candidate.canonicalize()?);
+ return Ok(candidate);
}
}
anyhow::bail!("no executable for `{}` found in PATH", exec.display())
} else {
- Ok(exec.canonicalize()?)
+ Ok(exec.into())
}
}
@@ -541,7 +539,18 @@
// gory details.
fs::copy(src, dst).map(|_| ())
} else {
- fs::hard_link(src, dst)
+ if cfg!(target_os = "macos") {
+ // This is a work-around for a bug on macos. There seems to be a race condition
+ // with APFS when hard-linking binaries. Gatekeeper does not have signing or
+ // hash informations stored in kernel when running the process. Therefore killing it.
+ // This problem does not appear when copying files as kernel has time to process it.
+ // Note that: fs::copy on macos is using CopyOnWrite (syscall fclonefileat) which should be
+ // as fast as hardlinking.
+ // See https://github.com/rust-lang/cargo/issues/10060 for the details
+ fs::copy(src, dst).map(|_| ())
+ } else {
+ fs::hard_link(src, dst)
+ }
};
link_result
.or_else(|err| {
diff -Nru cargo-0.58.0/crates/crates-io/Cargo.toml cargo-0.60.0ubuntu1/crates/crates-io/Cargo.toml
--- cargo-0.58.0/crates/crates-io/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/crates-io/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "crates-io"
-version = "0.33.0"
-edition = "2018"
-authors = ["Alex Crichton "]
+version = "0.33.1"
+edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = """
diff -Nru cargo-0.58.0/crates/credential/cargo-credential/Cargo.toml cargo-0.60.0ubuntu1/crates/credential/cargo-credential/Cargo.toml
--- cargo-0.58.0/crates/credential/cargo-credential/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/credential/cargo-credential/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-credential"
version = "0.1.0"
-authors = ["The Rust Project Developers"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = "A library to assist writing Cargo credential helpers."
diff -Nru cargo-0.58.0/crates/credential/cargo-credential-1password/Cargo.toml cargo-0.60.0ubuntu1/crates/credential/cargo-credential-1password/Cargo.toml
--- cargo-0.58.0/crates/credential/cargo-credential-1password/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/credential/cargo-credential-1password/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-credential-1password"
version = "0.1.0"
-authors = ["The Rust Project Developers"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens in a 1password vault."
diff -Nru cargo-0.58.0/crates/credential/cargo-credential-gnome-secret/Cargo.toml cargo-0.60.0ubuntu1/crates/credential/cargo-credential-gnome-secret/Cargo.toml
--- cargo-0.58.0/crates/credential/cargo-credential-gnome-secret/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/credential/cargo-credential-gnome-secret/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-credential-gnome-secret"
version = "0.1.0"
-authors = ["The Rust Project Developers"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens with GNOME libsecret."
diff -Nru cargo-0.58.0/crates/credential/cargo-credential-macos-keychain/Cargo.toml cargo-0.60.0ubuntu1/crates/credential/cargo-credential-macos-keychain/Cargo.toml
--- cargo-0.58.0/crates/credential/cargo-credential-macos-keychain/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/credential/cargo-credential-macos-keychain/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-credential-macos-keychain"
version = "0.1.0"
-authors = ["The Rust Project Developers"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens in a macOS keychain."
diff -Nru cargo-0.58.0/crates/credential/cargo-credential-wincred/Cargo.toml cargo-0.60.0ubuntu1/crates/credential/cargo-credential-wincred/Cargo.toml
--- cargo-0.58.0/crates/credential/cargo-credential-wincred/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/credential/cargo-credential-wincred/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "cargo-credential-wincred"
version = "0.1.0"
-authors = ["The Rust Project Developers"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens with Windows Credential Manager."
diff -Nru cargo-0.58.0/crates/mdman/Cargo.toml cargo-0.60.0ubuntu1/crates/mdman/Cargo.toml
--- cargo-0.58.0/crates/mdman/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/mdman/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,7 @@
[package]
name = "mdman"
version = "0.1.0"
-authors = ["Eric Huss"]
-edition = "2018"
+edition = "2021"
license = "MIT OR Apache-2.0"
description = "Creates a man page page from markdown."
diff -Nru cargo-0.58.0/crates/resolver-tests/Cargo.toml cargo-0.60.0ubuntu1/crates/resolver-tests/Cargo.toml
--- cargo-0.58.0/crates/resolver-tests/Cargo.toml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/crates/resolver-tests/Cargo.toml 2022-02-10 02:58:21.000000000 +0000
@@ -1,7 +1,6 @@
[package]
name = "resolver-tests"
version = "0.1.0"
-authors = ["Alex Crichton "]
edition = "2018"
[dependencies]
diff -Nru cargo-0.58.0/debian/changelog cargo-0.60.0ubuntu1/debian/changelog
--- cargo-0.58.0/debian/changelog 2022-01-25 06:45:44.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/changelog 2022-06-08 08:57:35.000000000 +0000
@@ -1,8 +1,18 @@
-cargo (0.58.0-0ubuntu1~21.10.1) impish; urgency=medium
+cargo (0.60.0ubuntu1-0ubuntu1~21.10.1) impish; urgency=medium
- * Backport to Impish. (LP: #1952104)
+ * Backport to impish (LP: #1968345)
- -- Michael Hudson-Doyle Tue, 25 Jan 2022 19:45:44 +1300
+ -- Simon Chopin Wed, 08 Jun 2022 10:57:35 +0200
+
+cargo (0.60.0ubuntu1-0ubuntu1) kinetic; urgency=medium
+
+ * Add an explicit mechanism to customize the vendoring process
+ * New upstream release:
+ - d/copyright: exclude the vendored benchmark workspaces
+ - d/copyright: Document new vendored crates
+ - d/p/{filetime-pr-75, libc-pr-2642}.patch: deleted, merged upstream
+
+ -- Simon Chopin Wed, 08 Jun 2022 10:41:56 +0200
cargo (0.58.0-0ubuntu1) jammy; urgency=medium
diff -Nru cargo-0.58.0/debian/copyright cargo-0.60.0ubuntu1/debian/copyright
--- cargo-0.58.0/debian/copyright 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/copyright 2022-06-08 08:41:49.000000000 +0000
@@ -1,6 +1,10 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: cargo
Source: https://github.com/rust-lang/cargo
+Files-Excluded:
+# We exclude the bench workspaces as they are full projects with their own
+# copyright issues
+ benches/workspaces/*
Files:
crates/*
@@ -266,6 +270,10 @@
* see https://github.com/withoutboats/failure
* see https://github.com/withoutboats/failure_derive
+Files: vendor/fastrand/*
+Copyright: 2020 Stjepan Glavina
+License: MIT or Apache-2.0
+
Files: vendor/fuchsia-cprng/*
Copyright:
2018 The Fuchsia Authors
@@ -406,6 +414,12 @@
License: MIT
Comment: see https://github.com/sfackler/rust-openssl
+Files: vendor/os_info/*
+Copyright:
+ 2017-2020 Jan Schulte
+ 2017-2022 Stanislav Tkach
+License: MIT
+
Files: vendor/pretty_env_logger/*
Copyright: 2016-2019 Sean McArthur
License: MIT or Apache-2.0
diff -Nru cargo-0.58.0/debian/debcargo-ubuntu/0001-libgit2-re-enable-the-C-library-vendoring.patch cargo-0.60.0ubuntu1/debian/debcargo-ubuntu/0001-libgit2-re-enable-the-C-library-vendoring.patch
--- cargo-0.58.0/debian/debcargo-ubuntu/0001-libgit2-re-enable-the-C-library-vendoring.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/debcargo-ubuntu/0001-libgit2-re-enable-the-C-library-vendoring.patch 2022-06-01 13:24:10.000000000 +0000
@@ -0,0 +1,37 @@
+From 81f1ea4eca200c53ec89fc07dea9f21fd3702432 Mon Sep 17 00:00:00 2001
+From: Simon Chopin
+Date: Wed, 20 Apr 2022 11:28:48 +0200
+Subject: [PATCH] libgit2: re-enable the C library vendoring
+
+This crate follows the C library very closely, which makes backporting
+cargo to older releases pretty much impossible as libgit2 in those
+releases doesn't have many of the APIs exposed in this crate, leading to
+linker errors. Bundling the C lib is the path of least resistance.
+---
+ src/libgit2-sys/debian/debcargo.toml | 2 +-
+ src/libgit2-sys/debian/patches/series | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/libgit2-sys/debian/debcargo.toml b/src/libgit2-sys/debian/debcargo.toml
+index 75f4d6ae1..9cb954489 100644
+--- a/src/libgit2-sys/debian/debcargo.toml
++++ b/src/libgit2-sys/debian/debcargo.toml
+@@ -1,6 +1,5 @@
+ overlay = "."
+ uploaders = ["Ximin Luo "]
+-excludes = ["libgit2/**"]
+ collapse_features = true
+
+ [packages.lib]
+diff --git a/src/libgit2-sys/debian/patches/series b/src/libgit2-sys/debian/patches/series
+index 6eaa45026..f1b8f3d85 100644
+--- a/src/libgit2-sys/debian/patches/series
++++ b/src/libgit2-sys/debian/patches/series
+@@ -1,3 +1,3 @@
+ no-special-snowflake-env.patch
+ remove-zlib-ng-compat.patch
+-disable-vendor.patch
++# disable-vendor.patch
+--
+2.34.1
+
diff -Nru cargo-0.58.0/debian/debcargo-ubuntu/README cargo-0.60.0ubuntu1/debian/debcargo-ubuntu/README
--- cargo-0.58.0/debian/debcargo-ubuntu/README 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/debcargo-ubuntu/README 2022-06-01 13:24:10.000000000 +0000
@@ -0,0 +1,2 @@
+This directory is to store patches to the debcargo conf that are applied when
+generating the vendor tarball for the Ubuntu release.
diff -Nru cargo-0.58.0/debian/debcargo-ubuntu/series cargo-0.60.0ubuntu1/debian/debcargo-ubuntu/series
--- cargo-0.58.0/debian/debcargo-ubuntu/series 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/debcargo-ubuntu/series 2022-06-01 13:24:10.000000000 +0000
@@ -0,0 +1 @@
+0001-libgit2-re-enable-the-C-library-vendoring.patch
diff -Nru cargo-0.58.0/debian/gbp.conf cargo-0.60.0ubuntu1/debian/gbp.conf
--- cargo-0.58.0/debian/gbp.conf 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/gbp.conf 2022-06-08 08:41:49.000000000 +0000
@@ -10,6 +10,6 @@
ignore-branch = True
sign-tags = True
-[import-orig]
-upstream-vcs-tag = %(version)s
-debian-branch = debian/experimental
+# [import-orig]
+# upstream-vcs-tag = %(version)s
+# debian-branch = debian/experimental
diff -Nru cargo-0.58.0/debian/patches/2111-curl-no-rebuild.patch cargo-0.60.0ubuntu1/debian/patches/2111-curl-no-rebuild.patch
--- cargo-0.58.0/debian/patches/2111-curl-no-rebuild.patch 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/patches/2111-curl-no-rebuild.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,12 +0,0 @@
-Already in debcargo-conf.git, can be deleted for next source import.
-
---- a/vendor/curl-sys/build.rs
-+++ b/vendor/curl-sys/build.rs
-@@ -4,7 +4,6 @@
- use std::process::Command;
-
- fn main() {
-- println!("cargo:rerun-if-changed=curl");
- let host = env::var("HOST").unwrap();
- let target = env::var("TARGET").unwrap();
- let windows = target.contains("windows");
diff -Nru cargo-0.58.0/debian/patches/filetime-pr-75.patch cargo-0.60.0ubuntu1/debian/patches/filetime-pr-75.patch
--- cargo-0.58.0/debian/patches/filetime-pr-75.patch 2022-01-24 21:24:43.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/patches/filetime-pr-75.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,92 +0,0 @@
-From 4bf69e074b288cd99965884c4501aa198efe9e3c Mon Sep 17 00:00:00 2001
-From: Alain Zscheile
-Date: Mon, 13 Dec 2021 16:34:28 +0100
-Subject: [PATCH] mark some functions as `const fn`, and some fix compiler
- warnings (#75)
-
-* mark fixed init functions and getters as const
-
-* fix compiler warnings
----
- src/lib.rs | 14 +++++++-------
- src/unix/utimes.rs | 1 +
- 2 files changed, 8 insertions(+), 7 deletions(-)
-
-diff --git a/vendor/filetime/src/lib.rs b/vendor/filetime/src/lib.rs
-index e29050e..817915c 100644
---- a/vendor/filetime/src/lib.rs
-+++ b/vendor/filetime/src/lib.rs
-@@ -71,14 +71,14 @@ impl FileTime {
- /// Creates a new timestamp representing a 0 time.
- ///
- /// Useful for creating the base of a cmp::max chain of times.
-- pub fn zero() -> FileTime {
-+ pub const fn zero() -> FileTime {
- FileTime {
- seconds: 0,
- nanos: 0,
- }
- }
-
-- fn emulate_second_only_system(self) -> FileTime {
-+ const fn emulate_second_only_system(self) -> FileTime {
- if cfg!(emulate_second_only_system) {
- FileTime {
- seconds: self.seconds,
-@@ -118,7 +118,7 @@ impl FileTime {
- /// from, but on Windows the native time stamp is relative to January 1,
- /// 1601 so the return value of `seconds` from the returned `FileTime`
- /// instance may not be the same as that passed in.
-- pub fn from_unix_time(seconds: i64, nanos: u32) -> FileTime {
-+ pub const fn from_unix_time(seconds: i64, nanos: u32) -> FileTime {
- FileTime {
- seconds: seconds + if cfg!(windows) { 11644473600 } else { 0 },
- nanos,
-@@ -193,7 +193,7 @@ impl FileTime {
- /// Note that this value's meaning is **platform specific**. On Unix
- /// platform time stamps are typically relative to January 1, 1970, but on
- /// Windows platforms time stamps are relative to January 1, 1601.
-- pub fn seconds(&self) -> i64 {
-+ pub const fn seconds(&self) -> i64 {
- self.seconds
- }
-
-@@ -202,7 +202,7 @@ impl FileTime {
- ///
- /// Note that this does not return the same value as `seconds` for Windows
- /// platforms as seconds are relative to a different date there.
-- pub fn unix_seconds(&self) -> i64 {
-+ pub const fn unix_seconds(&self) -> i64 {
- self.seconds - if cfg!(windows) { 11644473600 } else { 0 }
- }
-
-@@ -211,7 +211,7 @@ impl FileTime {
- /// The returned value is always less than one billion and represents a
- /// portion of a second forward from the seconds returned by the `seconds`
- /// method.
-- pub fn nanoseconds(&self) -> u32 {
-+ pub const fn nanoseconds(&self) -> u32 {
- self.nanos
- }
- }
-@@ -630,7 +630,7 @@ mod tests {
- fn set_symlink_dir_times_test() {
- let td = Builder::new().prefix("filetime").tempdir().unwrap();
- let path = td.path().join("foo");
-- fs::create_dir(&path);
-+ fs::create_dir(&path).unwrap();
-
- let metadata = fs::metadata(&path).unwrap();
- let mtime = FileTime::from_last_modification_time(&metadata);
-diff --git a/vendor/filetime/src/unix/utimes.rs b/vendor/filetime/src/unix/utimes.rs
-index 9926921..34bb882 100644
---- a/vendor/filetime/src/unix/utimes.rs
-+++ b/vendor/filetime/src/unix/utimes.rs
-@@ -118,6 +118,7 @@ fn to_timeval(ft: &FileTime) -> libc::timeval {
- }
- }
-
-+#[cfg(target_env = "uclibc")]
- fn to_timespec(ft: &FileTime) -> libc::timespec {
- libc::timespec {
- tv_sec: ft.seconds() as libc::time_t,
diff -Nru cargo-0.58.0/debian/patches/libc-pr-2642.patch cargo-0.60.0ubuntu1/debian/patches/libc-pr-2642.patch
--- cargo-0.58.0/debian/patches/libc-pr-2642.patch 2022-01-24 22:18:20.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/patches/libc-pr-2642.patch 1970-01-01 00:00:00.000000000 +0000
@@ -1,147 +0,0 @@
-From da84eefd712167bac47c904de3ac6056521c7f18 Mon Sep 17 00:00:00 2001
-From: Tamir Duberstein
-Date: Sat, 22 Jan 2022 08:13:30 -0500
-Subject: [PATCH] Define ip_mreqn on all Linux platforms
-
-Updates #1558.
----
- libc-test/build.rs | 5 +++++
- libc-test/semver/linux-aarch64.txt | 1 -
- libc-test/semver/linux-i686.txt | 1 -
- libc-test/semver/linux-mips.txt | 1 -
- libc-test/semver/linux-powerpc.txt | 1 -
- libc-test/semver/linux-powerpc64.txt | 1 -
- libc-test/semver/linux-powerpc64le.txt | 1 -
- libc-test/semver/linux-riscv64gc.txt | 1 -
- libc-test/semver/linux-x86_64.txt | 1 -
- libc-test/semver/linux.txt | 1 +
- src/unix/linux_like/android/mod.rs | 6 ------
- src/unix/linux_like/linux/gnu/b32/mod.rs | 6 ------
- src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs | 6 ------
- src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs | 6 ------
- src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs | 6 ------
- src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs | 6 ------
- src/unix/linux_like/linux/musl/mod.rs | 6 ------
- src/unix/linux_like/mod.rs | 6 ++++++
- 18 files changed, 12 insertions(+), 50 deletions(-)
-
---- a/vendor/libc/src/unix/linux_like/android/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/android/mod.rs
-@@ -73,12 +73,6 @@
- pub cmsg_type: ::c_int,
- }
-
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
--
- pub struct termios {
- pub c_iflag: ::tcflag_t,
- pub c_oflag: ::tcflag_t,
---- a/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b32/mod.rs
-@@ -135,12 +135,6 @@
- pub _f: [::c_char; 8],
- }
-
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
--
- pub struct semid_ds {
- pub sem_perm: ipc_perm,
- #[cfg(target_arch = "powerpc")]
---- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
-@@ -197,12 +197,6 @@
- pub ss_size: ::size_t
- }
-
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
--
- pub struct seccomp_notif_sizes {
- pub seccomp_notif: ::__u16,
- pub seccomp_notif_resp: ::__u16,
---- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
-@@ -191,12 +191,6 @@
- pub ss_flags: ::c_int,
- pub ss_size: ::size_t
- }
--
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
- }
-
- pub const POSIX_FADV_DONTNEED: ::c_int = 4;
---- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
-@@ -192,12 +192,6 @@
- pub l_len: ::off64_t,
- pub l_pid: ::pid_t,
- }
--
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
- }
-
- pub const POSIX_FADV_DONTNEED: ::c_int = 4;
---- a/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
-@@ -260,12 +260,6 @@
- __unused5: u64
- }
-
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
--
- pub struct seccomp_notif_sizes {
- pub seccomp_notif: ::__u16,
- pub seccomp_notif_resp: ::__u16,
---- a/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/linux/musl/mod.rs
-@@ -218,12 +218,6 @@
- pub rt_irtt: ::c_ushort,
- }
-
-- pub struct ip_mreqn {
-- pub imr_multiaddr: ::in_addr,
-- pub imr_address: ::in_addr,
-- pub imr_ifindex: ::c_int,
-- }
--
- pub struct __exit_status {
- pub e_termination: ::c_short,
- pub e_exit: ::c_short,
---- a/vendor/libc/src/unix/linux_like/mod.rs
-+++ b/vendor/libc/src/unix/linux_like/mod.rs
-@@ -25,6 +25,12 @@
- pub imr_interface: in_addr,
- }
-
-+ pub struct ip_mreqn {
-+ pub imr_multiaddr: in_addr,
-+ pub imr_address: in_addr,
-+ pub imr_ifindex: ::c_int,
-+ }
-+
- pub struct ip_mreq_source {
- pub imr_multiaddr: in_addr,
- pub imr_interface: in_addr,
diff -Nru cargo-0.58.0/debian/patches/series cargo-0.60.0ubuntu1/debian/patches/series
--- cargo-0.58.0/debian/patches/series 2022-01-24 22:18:20.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/patches/series 2022-06-08 08:41:49.000000000 +0000
@@ -1,5 +1,2 @@
2002_disable-net-tests.patch
-2111-curl-no-rebuild.patch
2112-handle-4-siphasher-algorithms.patch
-filetime-pr-75.patch
-libc-pr-2642.patch
diff -Nru cargo-0.58.0/debian/scripts/audit-vendor-source cargo-0.60.0ubuntu1/debian/scripts/audit-vendor-source
--- cargo-0.58.0/debian/scripts/audit-vendor-source 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/scripts/audit-vendor-source 2022-06-01 13:24:10.000000000 +0000
@@ -14,7 +14,7 @@
shift 2 # everything else is args to suspicious-source
# Remove tiny files 4 bytes or less
-find . -size -4c -delete
+find . -type f -size -4c -delete
# Remove non-suspicious files, warning on patterns that match nothing
echo "Excluding (i.e. removing) whitelisted files..."
grep -v '^#' "$whitelist" | xargs -I% sh -c 'rm -r ./% || true'
diff -Nru cargo-0.58.0/debian/scripts/debian-cargo-vendor cargo-0.60.0ubuntu1/debian/scripts/debian-cargo-vendor
--- cargo-0.58.0/debian/scripts/debian-cargo-vendor 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/debian/scripts/debian-cargo-vendor 2022-06-01 13:24:10.000000000 +0000
@@ -58,6 +58,12 @@
if [ -d debcargo-conf ]; then ( cd debcargo-conf && git pull );
else git clone "${DEBCARGO_CONF:-https://salsa.debian.org/rust-team/debcargo-conf}"; fi
+cd debcargo-conf
+# quilt returns 2 if no series is detected
+QUILT_PATCHES=$SRCDIR/debian/debcargo-ubuntu quilt pop -vaf || if [ "$?" -ne 2 ]; then exit 1; fi
+QUILT_PATCHES=$SRCDIR/debian/debcargo-ubuntu quilt push -va || if [ "$?" -ne 2 ]; then exit 1; fi
+cd ..
+
# keep applying patches, and drop to a subshell for manual fixing, until it succeeds
while ! ( cd vendor
x=true
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/bug_report.md cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/bug_report.md
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/bug_report.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/bug_report.md 1970-01-01 00:00:00.000000000 +0000
@@ -1,28 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-labels: C-bug
----
-
-
-
-**Problem**
-
-
-
-**Steps**
-
-1.
-2.
-3.
-
-**Possible Solution(s)**
-
-
-
-**Notes**
-
-Output of `cargo version --verbose`:
-
-
-
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/bug_report.yml cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/bug_report.yml
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/bug_report.yml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/bug_report.yml 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,43 @@
+name: Bug Report
+description: Create a report to help us improve
+labels: ["C-bug"]
+body:
+ - type: markdown
+ attributes:
+ value: Thanks for filing a 🐛 bug report 😄!
+ - type: textarea
+ id: problem
+ attributes:
+ label: Problem
+ description: >
+ Please provide a clear and concise description of what the bug is,
+ including what currently happens and what you expected to happen.
+ validations:
+ required: true
+ - type: textarea
+ id: steps
+ attributes:
+ label: Steps
+ description: Please list the steps to reproduce the bug.
+ placeholder: |
+ 1.
+ 2.
+ 3.
+ - type: textarea
+ id: possible-solutions
+ attributes:
+ label: Possible Solution(s)
+ description: >
+ Not obligatory, but suggest a fix/reason for the bug,
+ or ideas how to implement the addition or change.
+ - type: textarea
+ id: notes
+ attributes:
+ label: Notes
+ description: Provide any additional notes that might be helpful.
+ - type: textarea
+ id: version
+ attributes:
+ label: Version
+ description: Please paste the output of running `cargo version --verbose`.
+ render: text
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/config.yml cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/config.yml
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/config.yml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/config.yml 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,10 @@
+contact_links:
+ - name: Question
+ url: https://users.rust-lang.org
+ about: >
+ Got a question about Cargo? Ask the community on the user forum.
+ - name: Inspiring Idea
+ url: https://internals.rust-lang.org/c/tools-and-infrastructure/cargo
+ about: >
+ Need more discussions with your next big idea?
+ Reach out the coummunity on the internals forum.
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/feature_request.md cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/feature_request.md
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/feature_request.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/feature_request.md 1970-01-01 00:00:00.000000000 +0000
@@ -1,16 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-labels: C-feature-request
----
-
-
-
-**Describe the problem you are trying to solve**
-
-
-**Describe the solution you'd like**
-
-
-**Notes**
-
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/feature_request.yml cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/feature_request.yml
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/feature_request.yml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/feature_request.yml 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,35 @@
+name: Feature Request
+description: Suggest an idea for enhancing Cargo
+labels: ["C-feature-request"]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for filing a 🙋 feature request 😄!
+
+ If the feature request is relatively small and already with a possible solution, this might be the place for you.
+
+ If you are brewing a big feature that needs feedback from the community, [the internal forum] is the best fit, especially for pre-RFC. You can also talk the idea over with other developers in [#t-cargo Zulip stream].
+
+ [the internal forum]: https://internals.rust-lang.org/c/tools-and-infrastructure/cargo/15
+ [#t-cargo Zulip stream]: https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo
+ - type: textarea
+ id: problem
+ attributes:
+ label: Problem
+ description: >
+ Please provide a clear description of your use case and the problem
+ this feature request is trying to solve.
+ validations:
+ required: true
+ - type: textarea
+ id: solution
+ attributes:
+ label: Proposed Solution
+ description: >
+ Please provide a clear and concise description of what you want to happen.
+ - type: textarea
+ id: notes
+ attributes:
+ label: Notes
+ description: Provide any additional context or information that might be helpful.
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/tracking_issue.md cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/tracking_issue.md
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/tracking_issue.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/tracking_issue.md 1970-01-01 00:00:00.000000000 +0000
@@ -1,35 +0,0 @@
----
-name: Tracking Issue
-about: A tracking issue for an accepted feature or RFC in Cargo.
-title: Tracking Issue for XXX
-labels: C-tracking-issue
----
-
-
-**Summary**
-
-RFC: [#NNNN](https://github.com/rust-lang/rfcs/pull/NNNN)
-Original issue: #NNNN
-Implementation: #NNNN
-Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#my-feature
-
-
-
-**Unresolved issues**
-
-* [ ] Make a list of any known implementation or design issues.
-
-**Future extensions**
-
-
-
-**About tracking issues**
-
-Tracking issues are used to record the overall progress of implementation.
-They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
-A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
-Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
diff -Nru cargo-0.58.0/.github/ISSUE_TEMPLATE/tracking_issue.yml cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/tracking_issue.yml
--- cargo-0.58.0/.github/ISSUE_TEMPLATE/tracking_issue.yml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/ISSUE_TEMPLATE/tracking_issue.yml 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,50 @@
+name: Tracking Issue
+description: A tracking issue for an accepted feature or RFC in Cargo.
+title: "Tracking Issue for _FEATURE_NAME_"
+labels: ["C-tracking-issue"]
+body:
+ - type: markdown
+ attributes:
+ value: >
+ Thank you for creating a tracking issue! Tracking issues are for tracking an
+ accepted feature or RFC from implementation to stabilization. Please do not
+ file a tracking issue until the feature or RFC has been approved.
+ - type: textarea
+ id: summary
+ attributes:
+ label: Summary
+ description: Please provide a very brief summary of the feature.
+ value: |
+ RFC: [#NNNN](https://github.com/rust-lang/rfcs/pull/NNNN)
+ Original issue: #NNNN
+ Implementation: #NNNN
+ Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#my-feature
+
+ Please enter a short, one-sentence description here.
+ validations:
+ required: true
+ - type: textarea
+ id: unresolved
+ attributes:
+ label: Unresolved Issues
+ description: List issues that have not yet been resolved.
+ placeholder: |
+ * [ ] Make a list of any known implementation or design issues.
+ - type: textarea
+ id: future
+ attributes:
+ label: Future Extensions
+ description: >
+ An optional section where you can mention where the feature may be
+ extended in the future, but is explicitly not intended to
+ address.
+ - type: textarea
+ id: about
+ attributes:
+ label: About tracking issues
+ description: Please include this notice in the issue.
+ value: |
+ Tracking issues are used to record the overall progress of implementation.
+ They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
+ A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
+ Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
diff -Nru cargo-0.58.0/.github/PULL_REQUEST_TEMPLATE.md cargo-0.60.0ubuntu1/.github/PULL_REQUEST_TEMPLATE.md
--- cargo-0.58.0/.github/PULL_REQUEST_TEMPLATE.md 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/PULL_REQUEST_TEMPLATE.md 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,36 @@
+
diff -Nru cargo-0.58.0/.github/workflows/main.yml cargo-0.60.0ubuntu1/.github/workflows/main.yml
--- cargo-0.58.0/.github/workflows/main.yml 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/.github/workflows/main.yml 2022-02-10 02:58:21.000000000 +0000
@@ -19,7 +19,7 @@
- run: rustup component add rustfmt
- run: cargo fmt --all -- --check
- run: |
- for manifest in `find crates -name Cargo.toml`
+ for manifest in `find crates benches/benchsuite benches/capture -name Cargo.toml`
do
echo check fmt for $manifest
cargo fmt --all --manifest-path $manifest -- --check
@@ -68,7 +68,9 @@
# Deny warnings on CI to avoid warnings getting into the codebase.
- run: cargo test --features 'deny-warnings'
- - run: cargo test --features 'deny-warnings' -p cargo-test-support
+ - run: cargo test --features 'deny-warnings' --manifest-path crates/cargo-test-support/Cargo.toml
+ env:
+ CARGO_TARGET_DIR: target
- run: cargo test -p cargo-platform
- run: cargo test -p cargo-util
- run: cargo test --manifest-path crates/mdman/Cargo.toml
@@ -79,6 +81,15 @@
if: matrix.os == 'macos-latest'
- run: cargo build --manifest-path crates/credential/cargo-credential-wincred/Cargo.toml
if: matrix.os == 'windows-latest'
+ - name: Check benchmarks
+ env:
+ # Share the target dir to try to cache a few build-time deps.
+ CARGO_TARGET_DIR: target
+ run: |
+ # This only tests one benchmark since it can take over 10 minutes to
+ # download all workspaces.
+ cargo test --manifest-path benches/benchsuite/Cargo.toml --all-targets -- cargo
+ cargo check --manifest-path benches/capture/Cargo.toml
- name: Fetch smoke test
run: ci/fetch-smoke-test.sh
@@ -104,6 +115,7 @@
steps:
- uses: actions/checkout@v2
- run: rustup update nightly && rustup default nightly
+ - run: rustup update stable
- run: rustup component add rust-docs
- run: ci/validate-man.sh
# This requires rustfmt, use stable.
diff -Nru cargo-0.58.0/src/bin/cargo/cli.rs cargo-0.60.0ubuntu1/src/bin/cargo/cli.rs
--- cargo-0.58.0/src/bin/cargo/cli.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/cli.rs 2022-02-10 02:58:21.000000000 +0000
@@ -15,10 +15,10 @@
// Maps from commonly known external commands (not builtin to cargo) to their
// description, for the help page. Reserved for external subcommands that are
// core within the rust ecosystem (esp ones that might become internal in the future).
- static ref KNOWN_EXTERNAL_COMMAND_DESCRIPTIONS: HashMap<&'static str, &'static str> = vec![
+ static ref KNOWN_EXTERNAL_COMMAND_DESCRIPTIONS: HashMap<&'static str, &'static str> = HashMap::from([
("clippy", "Checks a package to catch common mistakes and improve your Rust code."),
("fmt", "Formats all bin and lib files of the current crate using rustfmt."),
- ].into_iter().collect();
+ ]);
}
pub fn main(config: &mut Config) -> CliResult {
@@ -65,7 +65,7 @@
.iter()
.map(|(option_name, option_help_message)| {
let option_name_kebab_case = option_name.replace("_", "-");
- let padding = " ".repeat(longest_option - option_name.len()); // safe to substract
+ let padding = " ".repeat(longest_option - option_name.len()); // safe to subtract
format!(
" -Z {}{} -- {}",
option_name_kebab_case, padding, option_help_message
@@ -139,7 +139,12 @@
}
}
CommandInfo::Alias { target } => {
- drop_println!(config, " {:<20} {}", name, target.iter().join(" "));
+ drop_println!(
+ config,
+ " {:<20} alias: {}",
+ name,
+ target.iter().join(" ")
+ );
}
}
}
@@ -164,10 +169,7 @@
let version = cargo::version();
let mut version_string = format!("cargo {}\n", version);
if is_verbose {
- version_string.push_str(&format!(
- "release: {}.{}.{}\n",
- version.major, version.minor, version.patch
- ));
+ version_string.push_str(&format!("release: {}\n", version.version,));
if let Some(ref cfg) = version.cfg_info {
if let Some(ref ci) = cfg.commit_info {
version_string.push_str(&format!("commit-hash: {}\n", ci.commit_hash));
@@ -261,6 +263,21 @@
}
(None, None) => {}
(_, Some(mut alias)) => {
+ // Check if this alias is shadowing an external subcommand
+ // (binary of the form `cargo-`)
+ // Currently this is only a warning, but after a transition period this will become
+ // a hard error.
+ if let Some(path) = super::find_external_subcommand(config, cmd) {
+ config.shell().warn(format!(
+ "\
+user-defined alias `{}` is shadowing an external subcommand found at: `{}`
+This was previously accepted but is being phased out; it will become a hard error in a future release.
+For more information, see issue #10049 .",
+ cmd,
+ path.display(),
+ ))?;
+ }
+
alias.extend(
args.values_of("")
.unwrap_or_default()
@@ -438,7 +455,7 @@
.multiple(true)
.global(true),
)
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(
opt("color", "Coloring: auto, always, never")
.value_name("WHEN")
diff -Nru cargo-0.58.0/src/bin/cargo/commands/bench.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/bench.rs
--- cargo-0.58.0/src/bin/cargo/commands/bench.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/bench.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
subcommand("bench")
.setting(AppSettings::TrailingVarArg)
.about("Execute all benchmarks of a local package")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(
Arg::with_name("BENCHNAME")
.help("If specified, only run benches containing this string in their names"),
diff -Nru cargo-0.58.0/src/bin/cargo/commands/build.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/build.rs
--- cargo-0.58.0/src/bin/cargo/commands/build.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/build.rs 2022-02-10 02:58:21.000000000 +0000
@@ -7,7 +7,7 @@
// subcommand aliases are handled in aliased_command()
// .alias("b")
.about("Compile a local package and all of its dependencies")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_package_spec(
"Package to build (see `cargo help pkgid`)",
"Build all packages in the workspace",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/check.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/check.rs
--- cargo-0.58.0/src/bin/cargo/commands/check.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/check.rs 2022-02-10 02:58:21.000000000 +0000
@@ -7,7 +7,7 @@
// subcommand aliases are handled in aliased_command()
// .alias("c")
.about("Check a local package and all of its dependencies for errors")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_package_spec(
"Package(s) to check",
"Check all packages in the workspace",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/clean.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/clean.rs
--- cargo-0.58.0/src/bin/cargo/commands/clean.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/clean.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
pub fn cli() -> App {
subcommand("clean")
.about("Remove artifacts that cargo has generated in the past")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_package_spec_simple("Package to clean artifacts for")
.arg_manifest_path()
.arg_target_triple("Target triple to clean output for")
diff -Nru cargo-0.58.0/src/bin/cargo/commands/doc.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/doc.rs
--- cargo-0.58.0/src/bin/cargo/commands/doc.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/doc.rs 2022-02-10 02:58:21.000000000 +0000
@@ -7,7 +7,7 @@
// subcommand aliases are handled in aliased_command()
// .alias("d")
.about("Build a package's documentation")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(opt(
"open",
"Opens the docs in a browser after the operation",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/fetch.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/fetch.rs
--- cargo-0.58.0/src/bin/cargo/commands/fetch.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/fetch.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
pub fn cli() -> App {
subcommand("fetch")
.about("Fetch dependencies of a package from the network")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_manifest_path()
.arg_target_triple("Fetch dependencies for the target triple")
.after_help("Run `cargo help fetch` for more detailed information.\n")
diff -Nru cargo-0.58.0/src/bin/cargo/commands/fix.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/fix.rs
--- cargo-0.58.0/src/bin/cargo/commands/fix.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/fix.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("fix")
.about("Automatically fix lint warnings reported by rustc")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_package_spec(
"Package(s) to fix",
"Fix all packages in the workspace",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/generate_lockfile.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/generate_lockfile.rs
--- cargo-0.58.0/src/bin/cargo/commands/generate_lockfile.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/generate_lockfile.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("generate-lockfile")
.about("Generate the lockfile for a package")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_manifest_path()
.after_help("Run `cargo help generate-lockfile` for more detailed information.\n")
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/help.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/help.rs
--- cargo-0.58.0/src/bin/cargo/commands/help.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/help.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1,6 +1,6 @@
use crate::aliased_command;
use cargo::util::errors::CargoResult;
-use cargo::Config;
+use cargo::{drop_println, Config};
use cargo_util::paths::resolve_executable;
use flate2::read::GzDecoder;
use std::ffi::OsString;
@@ -15,14 +15,14 @@
/// This runs before clap processing, because it needs to intercept the `help`
/// command if a man page is available.
///
-/// Returns `true` if a man page was displayed. In this case, Cargo should
-/// exit.
+/// Returns `true` if help information was successfully displayed to the user.
+/// In this case, Cargo should exit.
pub fn handle_embedded_help(config: &Config) -> bool {
match try_help(config) {
Ok(true) => true,
Ok(false) => false,
Err(e) => {
- log::warn!("man failed: {:?}", e);
+ log::warn!("help failed: {:?}", e);
false
}
}
@@ -46,26 +46,43 @@
Some(s) => s,
None => return Ok(false),
};
- // Check if this is a built-in command (or alias);
+
let subcommand = match check_alias(config, subcommand) {
+ // If this alias is more than a simple subcommand pass-through, show the alias.
+ Some(argv) if argv.len() > 1 => {
+ let alias = argv.join(" ");
+ drop_println!(config, "`{}` is aliased to `{}`", subcommand, alias);
+ return Ok(true);
+ }
+ // Otherwise, resolve the alias into its subcommand.
+ Some(argv) => {
+ // An alias with an empty argv can be created via `"empty-alias" = ""`.
+ let first = argv.get(0).map(String::as_str).unwrap_or(subcommand);
+ first.to_string()
+ }
+ None => subcommand.to_string(),
+ };
+
+ let subcommand = match check_builtin(&subcommand) {
Some(s) => s,
None => return Ok(false),
};
+
if resolve_executable(Path::new("man")).is_ok() {
- let man = match extract_man(&subcommand, "1") {
+ let man = match extract_man(subcommand, "1") {
Some(man) => man,
None => return Ok(false),
};
- write_and_spawn(&subcommand, &man, "man")?;
+ write_and_spawn(subcommand, &man, "man")?;
} else {
- let txt = match extract_man(&subcommand, "txt") {
+ let txt = match extract_man(subcommand, "txt") {
Some(txt) => txt,
None => return Ok(false),
};
if resolve_executable(Path::new("less")).is_ok() {
- write_and_spawn(&subcommand, &txt, "less")?;
+ write_and_spawn(subcommand, &txt, "less")?;
} else if resolve_executable(Path::new("more")).is_ok() {
- write_and_spawn(&subcommand, &txt, "more")?;
+ write_and_spawn(subcommand, &txt, "more")?;
} else {
drop(std::io::stdout().write_all(&txt));
}
@@ -73,24 +90,18 @@
Ok(true)
}
-/// Checks if the given subcommand is a built-in command (possibly via an alias).
+/// Checks if the given subcommand is an alias.
+///
+/// Returns None if it is not an alias.
+fn check_alias(config: &Config, subcommand: &str) -> Option> {
+ aliased_command(config, subcommand).ok().flatten()
+}
+
+/// Checks if the given subcommand is a built-in command (not via an alias).
///
/// Returns None if it is not a built-in command.
-fn check_alias(config: &Config, subcommand: &str) -> Option {
- if super::builtin_exec(subcommand).is_some() {
- return Some(subcommand.to_string());
- }
- match aliased_command(config, subcommand) {
- Ok(Some(alias)) => {
- let alias = alias.into_iter().next()?;
- if super::builtin_exec(&alias).is_some() {
- Some(alias)
- } else {
- None
- }
- }
- _ => None,
- }
+fn check_builtin(subcommand: &str) -> Option<&str> {
+ super::builtin_exec(subcommand).map(|_| subcommand)
}
/// Extracts the given man page from the compressed archive.
diff -Nru cargo-0.58.0/src/bin/cargo/commands/init.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/init.rs
--- cargo-0.58.0/src/bin/cargo/commands/init.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/init.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("init")
.about("Create a new cargo package in an existing directory")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("path").default_value("."))
.arg(opt("registry", "Registry to use").value_name("REGISTRY"))
.arg_new_opts()
diff -Nru cargo-0.58.0/src/bin/cargo/commands/install.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/install.rs
--- cargo-0.58.0/src/bin/cargo/commands/install.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/install.rs 2022-02-10 02:58:21.000000000 +0000
@@ -7,7 +7,7 @@
pub fn cli() -> App {
subcommand("install")
.about("Install a Rust binary. Default location is $HOME/.cargo/bin")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("crate").empty_values(false).multiple(true))
.arg(
opt("version", "Specify a version to install")
@@ -71,6 +71,7 @@
.requires("crate")
.conflicts_with_all(&["git", "path", "index"]),
)
+ .arg_message_format()
.after_help("Run `cargo help install` for more detailed information.\n")
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/locate_project.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/locate_project.rs
--- cargo-0.58.0/src/bin/cargo/commands/locate_project.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/locate_project.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
pub fn cli() -> App {
subcommand("locate-project")
.about("Print a JSON representation of a Cargo.toml file's location")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_manifest_path()
.arg(
opt(
diff -Nru cargo-0.58.0/src/bin/cargo/commands/login.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/login.rs
--- cargo-0.58.0/src/bin/cargo/commands/login.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/login.rs 2022-02-10 02:58:21.000000000 +0000
@@ -8,14 +8,8 @@
"Save an api token from the registry locally. \
If token is not specified, it will be read from stdin.",
)
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("token"))
- // --host is deprecated (use --registry instead)
- .arg(
- opt("host", "Host to set the token for")
- .value_name("HOST")
- .hidden(true),
- )
.arg(opt("registry", "Registry to use").value_name("REGISTRY"))
.after_help("Run `cargo help login` for more detailed information.\n")
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/logout.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/logout.rs
--- cargo-0.58.0/src/bin/cargo/commands/logout.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/logout.rs 2022-02-10 02:58:21.000000000 +0000
@@ -4,7 +4,7 @@
pub fn cli() -> App {
subcommand("logout")
.about("Remove an API token from the registry locally")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(opt("registry", "Registry to use").value_name("REGISTRY"))
.after_help("Run `cargo help logout` for more detailed information.\n")
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/metadata.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/metadata.rs
--- cargo-0.58.0/src/bin/cargo/commands/metadata.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/metadata.rs 2022-02-10 02:58:21.000000000 +0000
@@ -8,7 +8,7 @@
the concrete used versions including overrides, \
in machine-readable format",
)
- .arg(opt("quiet", "Do not print cargo log messages").short("q"))
+ .arg_quiet()
.arg_features()
.arg(multi_opt(
"filter-platform",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/new.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/new.rs
--- cargo-0.58.0/src/bin/cargo/commands/new.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/new.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("new")
.about("Create a new cargo package at ")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("path").required(true))
.arg(opt("registry", "Registry to use").value_name("REGISTRY"))
.arg_new_opts()
diff -Nru cargo-0.58.0/src/bin/cargo/commands/owner.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/owner.rs
--- cargo-0.58.0/src/bin/cargo/commands/owner.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/owner.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("owner")
.about("Manage the owners of a crate on the registry")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("crate"))
.arg(
multi_opt(
diff -Nru cargo-0.58.0/src/bin/cargo/commands/package.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/package.rs
--- cargo-0.58.0/src/bin/cargo/commands/package.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/package.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("package")
.about("Assemble the local package into a distributable tarball")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(
opt(
"list",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/pkgid.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/pkgid.rs
--- cargo-0.58.0/src/bin/cargo/commands/pkgid.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/pkgid.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
pub fn cli() -> App {
subcommand("pkgid")
.about("Print a fully qualified package specification")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("spec"))
.arg_package("Argument to get the package ID specifier for")
.arg_manifest_path()
diff -Nru cargo-0.58.0/src/bin/cargo/commands/publish.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/publish.rs
--- cargo-0.58.0/src/bin/cargo/commands/publish.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/publish.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("publish")
.about("Upload a package to the registry")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_index()
.arg(opt("token", "Token to use when uploading").value_name("TOKEN"))
.arg(opt(
@@ -32,7 +32,7 @@
let registry = args.registry(config)?;
let ws = args.workspace(config)?;
- let index = args.index(config)?;
+ let index = args.index()?;
ops::publish(
&ws,
diff -Nru cargo-0.58.0/src/bin/cargo/commands/read_manifest.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/read_manifest.rs
--- cargo-0.58.0/src/bin/cargo/commands/read_manifest.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/read_manifest.rs 2022-02-10 02:58:21.000000000 +0000
@@ -9,7 +9,7 @@
Deprecated, use `cargo metadata --no-deps` instead.\
",
)
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_manifest_path()
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/report.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/report.rs
--- cargo-0.58.0/src/bin/cargo/commands/report.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/report.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1,5 +1,4 @@
use crate::command_prelude::*;
-use anyhow::anyhow;
use cargo::core::compiler::future_incompat::{OnDiskReports, REPORT_PREAMBLE};
use cargo::drop_println;
@@ -18,14 +17,12 @@
"identifier of the report generated by a Cargo command invocation",
)
.value_name("id"),
- ),
+ )
+ .arg_package("Package to display a report for"),
)
}
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
- if !config.nightly_features_allowed {
- return Err(anyhow!("`cargo report` can only be used on the nightly channel").into());
- }
match args.subcommand() {
("future-incompatibilities", Some(args)) => report_future_incompatibilies(config, args),
(cmd, _) => panic!("unexpected command `{}`", cmd),
@@ -38,7 +35,8 @@
let id = args
.value_of_u32("id")?
.unwrap_or_else(|| reports.last_id());
- let report = reports.get_report(id, config)?;
+ let krate = args.value_of("package");
+ let report = reports.get_report(id, config, krate)?;
drop_println!(config, "{}", REPORT_PREAMBLE);
drop(config.shell().print_ansi_stdout(report.as_bytes()));
Ok(())
diff -Nru cargo-0.58.0/src/bin/cargo/commands/run.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/run.rs
--- cargo-0.58.0/src/bin/cargo/commands/run.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/run.rs 2022-02-10 02:58:21.000000000 +0000
@@ -10,7 +10,7 @@
// .alias("r")
.setting(AppSettings::TrailingVarArg)
.about("Run a binary or example of the local package")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("args").multiple(true))
.arg_targets_bin_example(
"Name of the bin target to run",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/rustc.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/rustc.rs
--- cargo-0.58.0/src/bin/cargo/commands/rustc.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/rustc.rs 2022-02-10 02:58:21.000000000 +0000
@@ -3,12 +3,13 @@
use cargo::util::interning::InternedString;
const PRINT_ARG_NAME: &str = "print";
+const CRATE_TYPE_ARG_NAME: &str = "crate-type";
pub fn cli() -> App {
subcommand("rustc")
.setting(AppSettings::TrailingVarArg)
.about("Compile a package, and pass extra options to the compiler")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("args").multiple(true).help("Rustc flags"))
.arg_package("Package to build")
.arg_jobs()
@@ -35,6 +36,11 @@
)
.value_name("INFO"),
)
+ .arg(multi_opt(
+ CRATE_TYPE_ARG_NAME,
+ "CRATE-TYPE",
+ "Comma separated list of types of crates for the compiler to emit (unstable)",
+ ))
.arg_target_dir()
.arg_manifest_path()
.arg_message_format()
@@ -75,8 +81,18 @@
.cli_unstable()
.fail_if_stable_opt(PRINT_ARG_NAME, 9357)?;
ops::print(&ws, &compile_opts, opt_value)?;
- } else {
- ops::compile(&ws, &compile_opts)?;
+ return Ok(());
}
+ let crate_types = values(args, CRATE_TYPE_ARG_NAME);
+ compile_opts.target_rustc_crate_types = if crate_types.is_empty() {
+ None
+ } else {
+ config
+ .cli_unstable()
+ .fail_if_stable_opt(CRATE_TYPE_ARG_NAME, 10083)?;
+ Some(crate_types)
+ };
+ ops::compile(&ws, &compile_opts)?;
+
Ok(())
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/rustdoc.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/rustdoc.rs
--- cargo-0.58.0/src/bin/cargo/commands/rustdoc.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/rustdoc.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
subcommand("rustdoc")
.setting(AppSettings::TrailingVarArg)
.about("Build a package's documentation, using specified custom flags.")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("args").multiple(true))
.arg(opt(
"open",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/search.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/search.rs
--- cargo-0.58.0/src/bin/cargo/commands/search.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/search.rs 2022-02-10 02:58:21.000000000 +0000
@@ -7,7 +7,7 @@
pub fn cli() -> App {
subcommand("search")
.about("Search packages in crates.io")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("query").multiple(true))
.arg_index()
.arg(
@@ -23,7 +23,7 @@
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
let registry = args.registry(config)?;
- let index = args.index(config)?;
+ let index = args.index()?;
let limit = args.value_of_u32("limit")?;
let limit = min(100, limit.unwrap_or(10));
let query: Vec<&str> = args.values_of("query").unwrap_or_default().collect();
diff -Nru cargo-0.58.0/src/bin/cargo/commands/test.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/test.rs
--- cargo-0.58.0/src/bin/cargo/commands/test.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/test.rs 2022-02-10 02:58:21.000000000 +0000
@@ -56,7 +56,10 @@
.arg_message_format()
.arg_unit_graph()
.arg_future_incompat_report()
- .after_help("Run `cargo help test` for more detailed information.\n")
+ .after_help(
+ "Run `cargo help test` for more detailed information.\n\
+ Run `cargo test -- --help` for test binary options.\n",
+ )
}
pub fn exec(config: &mut Config, args: &ArgMatches<'_>) -> CliResult {
diff -Nru cargo-0.58.0/src/bin/cargo/commands/tree.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/tree.rs
--- cargo-0.58.0/src/bin/cargo/commands/tree.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/tree.rs 2022-02-10 02:58:21.000000000 +0000
@@ -12,7 +12,7 @@
pub fn cli() -> App {
subcommand("tree")
.about("Display a tree visualization of a dependency graph")
- .arg(opt("quiet", "Suppress status messages").short("q"))
+ .arg_quiet()
.arg_manifest_path()
.arg_package_spec_no_all(
"Package to be used as the root of the tree",
diff -Nru cargo-0.58.0/src/bin/cargo/commands/uninstall.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/uninstall.rs
--- cargo-0.58.0/src/bin/cargo/commands/uninstall.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/uninstall.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("uninstall")
.about("Remove a Rust binary")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("spec").multiple(true))
.arg_package_spec_simple("Package to uninstall")
.arg(multi_opt("bin", "NAME", "Only uninstall the binary NAME"))
diff -Nru cargo-0.58.0/src/bin/cargo/commands/update.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/update.rs
--- cargo-0.58.0/src/bin/cargo/commands/update.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/update.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
pub fn cli() -> App {
subcommand("update")
.about("Update dependencies as recorded in the local lock file")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(opt("workspace", "Only update the workspace packages").short("w"))
.arg_package_spec_simple("Package to update")
.arg(opt(
diff -Nru cargo-0.58.0/src/bin/cargo/commands/vendor.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/vendor.rs
--- cargo-0.58.0/src/bin/cargo/commands/vendor.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/vendor.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("vendor")
.about("Vendor all dependencies for a project locally")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_manifest_path()
.arg(Arg::with_name("path").help("Where to vendor crates (`vendor` by default)"))
.arg(
diff -Nru cargo-0.58.0/src/bin/cargo/commands/verify_project.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/verify_project.rs
--- cargo-0.58.0/src/bin/cargo/commands/verify_project.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/verify_project.rs 2022-02-10 02:58:21.000000000 +0000
@@ -6,7 +6,7 @@
pub fn cli() -> App {
subcommand("verify-project")
.about("Check correctness of crate manifest")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg_manifest_path()
.after_help("Run `cargo help verify-project` for more detailed information.\n")
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/version.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/version.rs
--- cargo-0.58.0/src/bin/cargo/commands/version.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/version.rs 2022-02-10 02:58:21.000000000 +0000
@@ -4,7 +4,7 @@
pub fn cli() -> App {
subcommand("version")
.about("Show version information")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.after_help("Run `cargo help version` for more detailed information.\n")
}
diff -Nru cargo-0.58.0/src/bin/cargo/commands/yank.rs cargo-0.60.0ubuntu1/src/bin/cargo/commands/yank.rs
--- cargo-0.58.0/src/bin/cargo/commands/yank.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/commands/yank.rs 2022-02-10 02:58:21.000000000 +0000
@@ -5,7 +5,7 @@
pub fn cli() -> App {
subcommand("yank")
.about("Remove a pushed crate from the index")
- .arg(opt("quiet", "No output printed to stdout").short("q"))
+ .arg_quiet()
.arg(Arg::with_name("crate"))
.arg(
opt("vers", "The version to yank or un-yank")
diff -Nru cargo-0.58.0/src/bin/cargo/main.rs cargo-0.60.0ubuntu1/src/bin/cargo/main.rs
--- cargo-0.58.0/src/bin/cargo/main.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/bin/cargo/main.rs 2022-02-10 02:58:21.000000000 +0000
@@ -147,12 +147,16 @@
commands
}
-fn execute_external_subcommand(config: &Config, cmd: &str, args: &[&str]) -> CliResult {
+fn find_external_subcommand(config: &Config, cmd: &str) -> Option {
let command_exe = format!("cargo-{}{}", cmd, env::consts::EXE_SUFFIX);
- let path = search_directories(config)
+ search_directories(config)
.iter()
.map(|dir| dir.join(&command_exe))
- .find(|file| is_executable(file));
+ .find(|file| is_executable(file))
+}
+
+fn execute_external_subcommand(config: &Config, cmd: &str, args: &[&str]) -> CliResult {
+ let path = find_external_subcommand(config, cmd);
let command = match path {
Some(command) => command,
None => {
diff -Nru cargo-0.58.0/src/cargo/core/compiler/build_config.rs cargo-0.60.0ubuntu1/src/cargo/core/compiler/build_config.rs
--- cargo-0.58.0/src/cargo/core/compiler/build_config.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/cargo/core/compiler/build_config.rs 2022-02-10 02:58:21.000000000 +0000
@@ -149,6 +149,8 @@
Doc { deps: bool },
/// A target that will be tested with `rustdoc`.
Doctest,
+ /// An example or library that will be scraped for function calls by `rustdoc`.
+ Docscrape,
/// A marker for Units that represent the execution of a `build.rs` script.
RunCustomBuild,
}
@@ -166,6 +168,7 @@
Bench => "bench".serialize(s),
Doc { .. } => "doc".serialize(s),
Doctest => "doctest".serialize(s),
+ Docscrape => "docscrape".serialize(s),
RunCustomBuild => "run-custom-build".serialize(s),
}
}
@@ -187,6 +190,11 @@
self == CompileMode::Doctest
}
+ /// Returns `true` if this is scraping examples for documentation.
+ pub fn is_doc_scrape(self) -> bool {
+ self == CompileMode::Docscrape
+ }
+
/// Returns `true` if this is any type of test (test, benchmark, doc test, or
/// check test).
pub fn is_any_test(self) -> bool {
@@ -211,4 +219,15 @@
pub fn is_run_custom_build(self) -> bool {
self == CompileMode::RunCustomBuild
}
+
+ /// Returns `true` if this mode may generate an executable.
+ ///
+ /// Note that this also returns `true` for building libraries, so you also
+ /// have to check the target.
+ pub fn generates_executable(self) -> bool {
+ matches!(
+ self,
+ CompileMode::Test | CompileMode::Bench | CompileMode::Build
+ )
+ }
}
diff -Nru cargo-0.58.0/src/cargo/core/compiler/build_context/mod.rs cargo-0.60.0ubuntu1/src/cargo/core/compiler/build_context/mod.rs
--- cargo-0.58.0/src/cargo/core/compiler/build_context/mod.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/cargo/core/compiler/build_context/mod.rs 2022-02-10 02:58:21.000000000 +0000
@@ -33,6 +33,9 @@
/// Extra compiler args for either `rustc` or `rustdoc`.
pub extra_compiler_args: HashMap>,
+ // Crate types for `rustc`.
+ pub target_rustc_crate_types: HashMap>,
+
/// Package downloader.
///
/// This holds ownership of the `Package` objects.
@@ -47,6 +50,9 @@
/// The dependency graph of units to compile.
pub unit_graph: UnitGraph,
+ /// Reverse-dependencies of documented units, used by the rustdoc --scrape-examples flag.
+ pub scrape_units: Vec,
+
/// The list of all kinds that are involved in this build
pub all_kinds: HashSet,
}
@@ -58,9 +64,11 @@
build_config: &'a BuildConfig,
profiles: Profiles,
extra_compiler_args: HashMap>,
+ target_rustc_crate_types: HashMap>,
target_data: RustcTargetData<'cfg>,
roots: Vec,
unit_graph: UnitGraph,
+ scrape_units: Vec,
) -> CargoResult> {
let all_kinds = unit_graph
.keys()
@@ -76,9 +84,11 @@
build_config,
profiles,
extra_compiler_args,
+ target_rustc_crate_types,
target_data,
roots,
unit_graph,
+ scrape_units,
all_kinds,
})
}
@@ -122,4 +132,8 @@
pub fn extra_args_for(&self, unit: &Unit) -> Option<&Vec> {
self.extra_compiler_args.get(unit)
}
+
+ pub fn rustc_crate_types_args_for(&self, unit: &Unit) -> Option<&Vec> {
+ self.target_rustc_crate_types.get(unit)
+ }
}
diff -Nru cargo-0.58.0/src/cargo/core/compiler/build_context/target_info.rs cargo-0.60.0ubuntu1/src/cargo/core/compiler/build_context/target_info.rs
--- cargo-0.58.0/src/cargo/core/compiler/build_context/target_info.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/cargo/core/compiler/build_context/target_info.rs 2022-02-10 02:58:21.000000000 +0000
@@ -47,8 +47,8 @@
pub rustdocflags: Vec,
/// Whether or not rustc supports the `-Csplit-debuginfo` flag.
pub supports_split_debuginfo: bool,
- /// Whether or not rustc supports the `--force-warn` flag. Remove after 1.56 is stable.
- pub supports_force_warn: bool,
+ /// Whether or not rustc supports the `--json future-incompat` flag.
+ pub supports_json_future_incompat: bool,
}
/// Kind of each file generated by a Unit, part of `FileType`.
@@ -180,9 +180,12 @@
extra_fingerprint,
)
.is_ok();
- let supports_force_warn = rustc
+
+ let supports_json_future_incompat = rustc
.cached_output(
- process.clone().arg("--force-warn=rust-2021-compatibility"),
+ process
+ .clone()
+ .args(&["--error-format", "json", "--json", "future-incompat"]),
extra_fingerprint,
)
.is_ok();
@@ -261,7 +264,7 @@
)?,
cfg,
supports_split_debuginfo,
- supports_force_warn,
+ supports_json_future_incompat,
})
}
@@ -461,7 +464,10 @@
}
}
CompileMode::Check { .. } => Ok((vec![FileType::new_rmeta()], Vec::new())),
- CompileMode::Doc { .. } | CompileMode::Doctest | CompileMode::RunCustomBuild => {
+ CompileMode::Doc { .. }
+ | CompileMode::Doctest
+ | CompileMode::Docscrape
+ | CompileMode::RunCustomBuild => {
panic!("asked for rustc output for non-rustc mode")
}
}
diff -Nru cargo-0.58.0/src/cargo/core/compiler/context/compilation_files.rs cargo-0.60.0ubuntu1/src/cargo/core/compiler/context/compilation_files.rs
--- cargo-0.58.0/src/cargo/core/compiler/context/compilation_files.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/cargo/core/compiler/context/compilation_files.rs 2022-02-10 02:58:21.000000000 +0000
@@ -191,7 +191,9 @@
/// Returns the directory where the artifacts for the given unit are
/// initially created.
pub fn out_dir(&self, unit: &Unit) -> PathBuf {
- if unit.mode.is_doc() {
+ // Docscrape units need to have doc/ set as the out_dir so sources for reverse-dependencies
+ // will be put into doc/ and not into deps/ where the *.examples files are stored.
+ if unit.mode.is_doc() || unit.mode.is_doc_scrape() {
self.layout(unit.kind).doc().to_path_buf()
} else if unit.mode.is_doc_test() {
panic!("doc tests do not have an out dir");
@@ -417,6 +419,17 @@
// but Cargo does not know about that.
vec![]
}
+ CompileMode::Docscrape => {
+ let path = self
+ .deps_dir(unit)
+ .join(format!("{}.examples", unit.buildkey()));
+ vec![OutputFile {
+ path,
+ hardlink: None,
+ export_path: None,
+ flavor: FileFlavor::Normal,
+ }]
+ }
CompileMode::Test
| CompileMode::Build
| CompileMode::Bench
diff -Nru cargo-0.58.0/src/cargo/core/compiler/context/mod.rs cargo-0.60.0ubuntu1/src/cargo/core/compiler/context/mod.rs
--- cargo-0.58.0/src/cargo/core/compiler/context/mod.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/cargo/core/compiler/context/mod.rs 2022-02-10 02:58:21.000000000 +0000
@@ -2,15 +2,14 @@
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
-use anyhow::{bail, Context as _};
-use filetime::FileTime;
-use jobserver::Client;
-
use crate::core::compiler::compilation::{self, UnitOutput};
use crate::core::compiler::{self, Unit};
use crate::core::PackageId;
use crate::util::errors::CargoResult;
use crate::util::profile;
+use anyhow::{bail, Context as _};
+use filetime::FileTime;
+use jobserver::Client;
use super::build_plan::BuildPlan;
use super::custom_build::{self, BuildDeps, BuildScriptOutputs, BuildScripts};
@@ -81,6 +80,10 @@
/// compilation is happening (only object, only bitcode, both, etc), and is
/// precalculated early on.
pub lto: HashMap,
+
+ /// Map of Doc/Docscrape units to metadata for their -Cmetadata flag.
+ /// See Context::find_metadata_units for more details.
+ pub metadata_for_doc_units: HashMap,
}
impl<'a, 'cfg> Context<'a, 'cfg> {
@@ -121,6 +124,7 @@
rustc_clients: HashMap::new(),
pipelining,
lto: HashMap::new(),
+ metadata_for_doc_units: HashMap::new(),
})
}
@@ -135,6 +139,7 @@
self.prepare()?;
custom_build::build_map(&mut self)?;
self.check_collisions()?;
+ self.compute_metadata_for_doc_units();
// We need to make sure that if there were any previous docs
// already compiled, they were compiled with the same Rustc version that we're currently
@@ -241,6 +246,13 @@
args.push("--cfg".into());
args.push(cfg.into());
}
+
+ for (lt, arg) in &output.linker_args {
+ if lt.applies_to(&unit.target) {
+ args.push("-C".into());
+ args.push(format!("link-arg={}", arg).into());
+ }
+ }
}
}
args.extend(self.bcx.rustdocflags_args(unit).iter().map(Into::into));
@@ -282,19 +294,16 @@
/// Returns the executable for the specified unit (if any).
pub fn get_executable(&mut self, unit: &Unit) -> CargoResult
The output format for diagnostic messages. Can be specified multiple times
+and consists of comma-separated values. Valid values:
+
+
human (default): Display in a human-readable text format. Conflicts with
+short and json.
+
short: Emit shorter, human-readable text messages. Conflicts with human
+and json.
+
json: Emit JSON messages to stdout. See
+the reference
+for more details. Conflicts with human and short.
+
json-diagnostic-short: Ensure the rendered field of JSON messages contains
+the "short" rendering from rustc. Cannot be used with human or short.
+
json-diagnostic-rendered-ansi: Ensure the rendered field of JSON messages
+contains embedded ANSI color codes for respecting rustc's default color
+scheme. Cannot be used with human or short.
+
json-render-diagnostics: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo's own JSON diagnostics and others
+coming from rustc are still emitted. Cannot be used with human or short.
Do not print cargo log messages.
+May also be specified with the term.quiet
+config value.
--colorwhen
diff -Nru cargo-0.58.0/src/doc/src/getting-started/first-steps.md cargo-0.60.0ubuntu1/src/doc/src/getting-started/first-steps.md
--- cargo-0.58.0/src/doc/src/getting-started/first-steps.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/getting-started/first-steps.md 2022-02-10 02:58:21.000000000 +0000
@@ -33,7 +33,7 @@
[package]
name = "hello_world"
version = "0.1.0"
-edition = "2018"
+edition = "2021"
[dependencies]
```
diff -Nru cargo-0.58.0/src/doc/src/guide/continuous-integration.md cargo-0.60.0ubuntu1/src/doc/src/guide/continuous-integration.md
--- cargo-0.58.0/src/doc/src/guide/continuous-integration.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/guide/continuous-integration.md 2022-02-10 02:58:21.000000000 +0000
@@ -21,6 +21,40 @@
documentation](https://docs.travis-ci.com/user/languages/rust/) for more
information.
+### GitHub Actions
+
+To test your package on GitHub Actions, here is a sample `.github/workflows/ci.yml` file:
+
+```yaml
+name: Cargo Build & Test
+
+on:
+ push:
+ pull_request:
+
+env:
+ CARGO_TERM_COLOR: always
+
+jobs:
+ build_and_test:
+ name: Rust project - latest
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ toolchain:
+ - stable
+ - beta
+ - nightly
+ steps:
+ - uses: actions/checkout@v2
+ - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
+ - run: cargo build --verbose
+ - run: cargo test --verbose
+
+```
+
+This will test all three release channels (note a failure in any toolchain version will fail the entire job). You can also click `"Actions" > "new workflow"` in the GitHub UI and select Rust to add the [default configuration](https://github.com/actions/starter-workflows/blob/main/ci/rust.yml) to your repo. See [GitHub Actions documentation](https://docs.github.com/en/actions) for more information.
+
### GitLab CI
To test your package on GitLab CI, here is a sample `.gitlab-ci.yml` file:
diff -Nru cargo-0.58.0/src/doc/src/guide/creating-a-new-project.md cargo-0.60.0ubuntu1/src/doc/src/guide/creating-a-new-project.md
--- cargo-0.58.0/src/doc/src/guide/creating-a-new-project.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/guide/creating-a-new-project.md 2022-02-10 02:58:21.000000000 +0000
@@ -29,7 +29,7 @@
[package]
name = "hello_world"
version = "0.1.0"
-edition = "2018"
+edition = "2021"
[dependencies]
diff -Nru cargo-0.58.0/src/doc/src/guide/dependencies.md cargo-0.60.0ubuntu1/src/doc/src/guide/dependencies.md
--- cargo-0.58.0/src/doc/src/guide/dependencies.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/guide/dependencies.md 2022-02-10 02:58:21.000000000 +0000
@@ -20,11 +20,11 @@
time = "0.1.12"
```
-The version string is a [semver] version requirement. The [specifying
+The version string is a [SemVer] version requirement. The [specifying
dependencies](../reference/specifying-dependencies.md) docs have more information about
the options you have here.
-[semver]: https://github.com/steveklabnik/semver#requirements
+[SemVer]: https://semver.org
If we also wanted to add a dependency on the `regex` crate, we would not need
to add `[dependencies]` for each crate listed. Here's what your whole
@@ -35,7 +35,7 @@
[package]
name = "hello_world"
version = "0.1.0"
-edition = "2018"
+edition = "2021"
[dependencies]
time = "0.1.12"
diff -Nru cargo-0.58.0/src/doc/src/reference/build-script-examples.md cargo-0.60.0ubuntu1/src/doc/src/reference/build-script-examples.md
--- cargo-0.58.0/src/doc/src/reference/build-script-examples.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/build-script-examples.md 2022-02-10 02:58:21.000000000 +0000
@@ -147,7 +147,7 @@
[package]
name = "hello-world-from-c"
version = "0.1.0"
-edition = "2018"
+edition = "2021"
```
For now we’re not going to use any build dependencies, so let’s take a look at
@@ -297,7 +297,7 @@
[package]
name = "libz-sys"
version = "0.1.0"
-edition = "2018"
+edition = "2021"
links = "z"
[build-dependencies]
@@ -384,7 +384,7 @@
[package]
name = "zuser"
version = "0.1.0"
-edition = "2018"
+edition = "2021"
[dependencies]
libz-sys = "1.0.25"
diff -Nru cargo-0.58.0/src/doc/src/reference/config.md cargo-0.60.0ubuntu1/src/doc/src/reference/config.md
--- cargo-0.58.0/src/doc/src/reference/config.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/config.md 2022-02-10 02:58:21.000000000 +0000
@@ -87,6 +87,9 @@
# Value is relative to .cargo directory containing `config.toml`, make absolute
ENV_VAR_NAME_3 = { value = "relative/path", relative = true }
+[future-incompat-report]
+frequency = 'always' # when to display a notification about a future incompat report
+
[cargo-new]
vcs = "none" # VCS to use ('git', 'hg', 'pijul', 'fossil', 'none')
@@ -168,6 +171,7 @@
metadata_key2 = "value"
[term]
+quiet = false # whether cargo output is quiet
verbose = false # whether cargo provides verbose output
color = 'auto' # whether cargo colorizes output
progress.when = 'auto' # whether cargo shows progress bar
@@ -504,6 +508,20 @@
OPENSSL_DIR = { value = "vendor/openssl", relative = true }
```
+### `[future-incompat-report]`
+
+The `[future-incompat-report]` table controls setting for [future incompat reporting](future-incompat-report.md)
+
+#### `future-incompat-report.frequency`
+* Type: string
+* Default: "always"
+* Environment: `CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY`
+
+Controls how often we display a notification to the terminal when a future incompat report is available. Possible values:
+
+* `always` (default): Always display a notification when a command (e.g. `cargo build`) produces a future incompat report
+* `never`: Never display a notification
+
#### `[http]`
The `[http]` table defines settings for HTTP behavior. This includes fetching
@@ -992,6 +1010,16 @@
The `[term]` table controls terminal output and interaction.
+##### `term.quiet`
+* Type: boolean
+* Default: false
+* Environment: `CARGO_TERM_QUIET`
+
+Controls whether or not log messages are displayed by Cargo.
+
+Specifying the `--quiet` flag will override and force quiet output.
+Specifying the `--verbose` flag will override and disable quiet output.
+
##### `term.verbose`
* Type: boolean
* Default: false
diff -Nru cargo-0.58.0/src/doc/src/reference/environment-variables.md cargo-0.60.0ubuntu1/src/doc/src/reference/environment-variables.md
--- cargo-0.58.0/src/doc/src/reference/environment-variables.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/environment-variables.md 2022-02-10 02:58:21.000000000 +0000
@@ -83,6 +83,7 @@
* `CARGO_BUILD_DEP_INFO_BASEDIR` — Dep-info relative directory, see [`build.dep-info-basedir`].
* `CARGO_BUILD_PIPELINING` — Whether or not to use `rustc` pipelining, see [`build.pipelining`].
* `CARGO_CARGO_NEW_VCS` — The default source control system with [`cargo new`], see [`cargo-new.vcs`].
+* `CARGO_FUTURE_INCOMPAT_REPORT_FREQUENCY` - How often we should generate a future incompat report notifcation, see [`future-incompat-report.frequency`].
* `CARGO_HTTP_DEBUG` — Enables HTTP debugging, see [`http.debug`].
* `CARGO_HTTP_PROXY` — Enables HTTP proxy, see [`http.proxy`].
* `CARGO_HTTP_TIMEOUT` — The HTTP timeout, see [`http.timeout`].
@@ -114,6 +115,7 @@
* `CARGO_TARGET__LINKER` — The linker to use, see [`target..linker`]. The triple must be [converted to uppercase and underscores](config.md#environment-variables).
* `CARGO_TARGET__RUNNER` — The executable runner, see [`target..runner`].
* `CARGO_TARGET__RUSTFLAGS` — Extra `rustc` flags for a target, see [`target..rustflags`].
+* `CARGO_TERM_QUIET` — Quiet mode, see [`term.quiet`].
* `CARGO_TERM_VERBOSE` — The default terminal verbosity, see [`term.verbose`].
* `CARGO_TERM_COLOR` — The default color mode, see [`term.color`].
* `CARGO_TERM_PROGRESS_WHEN` — The default progress bar showing mode, see [`term.progress.when`].
@@ -144,6 +146,7 @@
[`cargo-new.name`]: config.md#cargo-newname
[`cargo-new.email`]: config.md#cargo-newemail
[`cargo-new.vcs`]: config.md#cargo-newvcs
+[`future-incompat-report.frequency`]: config.md#future-incompat-reportfrequency
[`http.debug`]: config.md#httpdebug
[`http.proxy`]: config.md#httpproxy
[`http.timeout`]: config.md#httptimeout
@@ -175,6 +178,7 @@
[`target..linker`]: config.md#targettriplelinker
[`target..runner`]: config.md#targettriplerunner
[`target..rustflags`]: config.md#targettriplerustflags
+[`term.quiet`]: config.md#termquiet
[`term.verbose`]: config.md#termverbose
[`term.color`]: config.md#termcolor
[`term.progress.when`]: config.md#termprogresswhen
@@ -353,10 +357,10 @@
changed by editing `.cargo/config.toml`; see the documentation
about [cargo configuration][cargo-config] for more
information.
-* `CARGO_ENCODED_RUSTFLAGS` — extra flags that Cargo invokes `rustc`
- with, separated by a `0x1f` character
- (ASCII Unit Separator). See
- [`build.rustflags`].
+* `CARGO_ENCODED_RUSTFLAGS` — extra flags that Cargo invokes `rustc` with,
+ separated by a `0x1f` character (ASCII Unit Separator). See
+ [`build.rustflags`]. Note that since Rust 1.55, `RUSTFLAGS` is removed from
+ the environment; scripts should use `CARGO_ENCODED_RUSTFLAGS` instead.
* `CARGO_PKG_` - The package information variables, with the same names and values as are [provided during crate building][variables set for crates].
[unix-like platforms]: ../../reference/conditional-compilation.html#unix-and-windows
diff -Nru cargo-0.58.0/src/doc/src/reference/future-incompat-report.md cargo-0.60.0ubuntu1/src/doc/src/reference/future-incompat-report.md
--- cargo-0.58.0/src/doc/src/reference/future-incompat-report.md 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/future-incompat-report.md 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,24 @@
+### Future incompat report
+
+Cargo checks for future-incompatible warnings in all dependencies. These are warnings for
+changes that may become hard errors in the future, causing the dependency to
+stop building in a future version of rustc. If any warnings are found, a small
+notice is displayed indicating that the warnings were found, and provides
+instructions on how to display a full report.
+
+A full report can be displayed with the `cargo report future-incompatibilities
+--id ID` command, or by running the build again with
+the `--future-incompat-report` flag. The developer should then update their
+dependencies to a version where the issue is fixed, or work with the
+developers of the dependencies to help resolve the issue.
+
+This feature can be configured through a `[future-incompat-report]`
+section in `.cargo/config`. Currently, the supported options are:
+
+```
+[future-incompat-report]
+frequency = FREQUENCY
+```
+
+The supported values for `FREQUENCY` are 'always` and 'never', which control
+whether or not a message is printed out at the end of `cargo build` / `cargo check`.
diff -Nru cargo-0.58.0/src/doc/src/reference/index.md cargo-0.60.0ubuntu1/src/doc/src/reference/index.md
--- cargo-0.58.0/src/doc/src/reference/index.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/index.md 2022-02-10 02:58:21.000000000 +0000
@@ -21,4 +21,5 @@
* [Registries](registries.md)
* [Dependency Resolution](resolver.md)
* [SemVer Compatibility](semver.md)
+* [Future incompat report](future-incompat-report.md)
* [Unstable Features](unstable.md)
diff -Nru cargo-0.58.0/src/doc/src/reference/profiles.md cargo-0.60.0ubuntu1/src/doc/src/reference/profiles.md
--- cargo-0.58.0/src/doc/src/reference/profiles.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/profiles.md 2022-02-10 02:58:21.000000000 +0000
@@ -93,6 +93,28 @@
[nightly channel]: ../../book/appendix-07-nightly-rust.html
[`-C split-debuginfo` flag]: ../../rustc/codegen-options/index.html#split-debuginfo
+#### strip
+
+The `strip` option controls the [`-C strip` flag], which directs rustc to
+strip either symbols or debuginfo from a binary. This can be enabled like so:
+
+```toml
+[package]
+# ...
+
+[profile.release]
+strip = "debuginfo"
+```
+
+Possible string values of `strip` are `"none"`, `"debuginfo"`, and `"symbols"`.
+The default is `"none"`.
+
+You can also configure this option with the boolean values `true` or `false`.
+`strip = true` is equivalent to `strip = "symbols"`. `strip = false` is
+equivalent to `strip = "none"` and disables `strip` completely.
+
+[`-C strip` flag]: ../../rustc/codegen-options/index.html#strip
+
#### debug-assertions
The `debug-assertions` setting controls the [`-C debug-assertions` flag] which
@@ -266,15 +288,13 @@
#### test
-The `test` profile is used for building tests, or when benchmarks are built in
-debug mode with `cargo build`. By default, the `test` profile inherits the
-settings from the [`dev`](#dev) profile.
+The `test` profile is the default profile used by [`cargo test`].
+The `test` profile inherits the settings from the [`dev`](#dev) profile.
#### bench
-The `bench` profile is used for building benchmarks, or when tests are built
-with the `--release` flag. By default, the `bench` profile inherits the
-settings from the [`release`](#release) profile.
+The `bench` profile is the default profile used by [`cargo bench`].
+The `bench` profile inherits the settings from the [`release`](#release) profile.
#### Build Dependencies
@@ -293,7 +313,7 @@
```
Build dependencies otherwise inherit settings from the active profile in use, as
-described below.
+described in [Profile selection](#profile-selection).
### Custom profiles
@@ -331,11 +351,22 @@
`--release` or `--profile`, and the package (in the case of
[overrides](#overrides)). The default profile if none is specified is:
-* Build commands like [`cargo build`], [`cargo rustc`], [`cargo check`], and
-[`cargo run`]: [`dev` profile](#dev)
-* [`cargo test`]: [`test` profile](#test)
-* [`cargo bench`]: [`bench` profile](#bench)
-* [`cargo install`]: [`release` profile](#release)
+| Command | Default Profile |
+|---------|-----------------|
+| [`cargo run`], [`cargo build`], [`cargo check`], [`cargo rustc`] | [`dev` profile](#dev) |
+| [`cargo test`] | [`test` profile](#test)
+| [`cargo bench`] | [`bench` profile](#bench)
+| [`cargo install`] | [`release` profile](#release)
+
+You can switch to a different profile using the `--profile=NAME` option which will used the given profile.
+The `--release` flag is equivalent to `--profile=release`.
+
+The selected profile applies to all Cargo targets,
+including [library](./cargo-targets.md#library),
+[binary](./cargo-targets.md#binaries),
+[example](./cargo-targets.md#examples),
+[test](./cargo-targets.md#tests),
+and [benchmark](./cargo-targets.md#benchmarks).
The profile for specific packages can be specified with
[overrides](#overrides), described below.
diff -Nru cargo-0.58.0/src/doc/src/reference/registries.md cargo-0.60.0ubuntu1/src/doc/src/reference/registries.md
--- cargo-0.58.0/src/doc/src/reference/registries.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/registries.md 2022-02-10 02:58:21.000000000 +0000
@@ -222,9 +222,9 @@
// this is the new name. The original package name is stored in
// the `package` field.
"name": "rand",
- // The semver requirement for this dependency.
+ // The SemVer requirement for this dependency.
// This must be a valid version requirement defined at
- // https://github.com/steveklabnik/semver#requirements.
+ // https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html.
"req": "^0.6",
// Array of features (as strings) enabled for this dependency.
"features": ["i128_support"],
diff -Nru cargo-0.58.0/src/doc/src/reference/specifying-dependencies.md cargo-0.60.0ubuntu1/src/doc/src/reference/specifying-dependencies.md
--- cargo-0.58.0/src/doc/src/reference/specifying-dependencies.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/specifying-dependencies.md 2022-02-10 02:58:21.000000000 +0000
@@ -19,35 +19,30 @@
time = "0.1.12"
```
-The string `"0.1.12"` is a [semver] version requirement. Since this
-string does not have any operators in it, it is interpreted the same way as
-if we had specified `"^0.1.12"`, which is called a caret requirement.
+The string `"0.1.12"` is a version requirement. Although it looks like a
+specific *version* of the `time` crate, it actually specifies a *range* of
+versions and allows [SemVer] compatible updates. An update is allowed if the new
+version number does not modify the left-most non-zero digit in the major, minor,
+patch grouping. In this case, if we ran `cargo update -p time`, cargo should
+update us to version `0.1.13` if it is the latest `0.1.z` release, but would not
+update us to `0.2.0`. If instead we had specified the version string as `1.0`,
+cargo should update to `1.1` if it is the latest `1.y` release, but not `2.0`.
+The version `0.0.x` is not considered compatible with any other version.
-[semver]: https://github.com/steveklabnik/semver#requirements
+[SemVer]: https://semver.org
-### Caret requirements
-
-**Caret requirements** allow SemVer compatible updates to a specified version.
-An update is allowed if the new version number does not modify the left-most
-non-zero digit in the major, minor, patch grouping. In this case, if we ran
-`cargo update -p time`, cargo should update us to version `0.1.13` if it is the
-latest `0.1.z` release, but would not update us to `0.2.0`. If instead we had
-specified the version string as `^1.0`, cargo should update to `1.1` if it is
-the latest `1.y` release, but not `2.0`. The version `0.0.x` is not considered
-compatible with any other version.
-
-Here are some more examples of caret requirements and the versions that would
+Here are some more examples of version requirements and the versions that would
be allowed with them:
```notrust
-^1.2.3 := >=1.2.3, <2.0.0
-^1.2 := >=1.2.0, <2.0.0
-^1 := >=1.0.0, <2.0.0
-^0.2.3 := >=0.2.3, <0.3.0
-^0.2 := >=0.2.0, <0.3.0
-^0.0.3 := >=0.0.3, <0.0.4
-^0.0 := >=0.0.0, <0.1.0
-^0 := >=0.0.0, <1.0.0
+1.2.3 := >=1.2.3, <2.0.0
+1.2 := >=1.2.0, <2.0.0
+1 := >=1.0.0, <2.0.0
+0.2.3 := >=0.2.3, <0.3.0
+0.2 := >=0.2.0, <0.3.0
+0.0.3 := >=0.0.3, <0.0.4
+0.0 := >=0.0.0, <0.1.0
+0 := >=0.0.0, <1.0.0
```
This compatibility convention is different from SemVer in the way it treats
@@ -55,6 +50,14 @@
1.0.0, Cargo considers `0.x.y` to be compatible with `0.x.z`, where `y ≥ z`
and `x > 0`.
+It is possible to further tweak the logic for selecting compatible versions
+using special operators, though it shouldn't be necessary most of the time.
+
+### Caret requirements
+
+**Caret requirements** are an alternative syntax for the default strategy,
+`^1.2.3` is exactly equivalent to `1.2.3`.
+
### Tilde requirements
**Tilde requirements** specify a minimal version with some ability to update.
diff -Nru cargo-0.58.0/src/doc/src/reference/unstable.md cargo-0.60.0ubuntu1/src/doc/src/reference/unstable.md
--- cargo-0.58.0/src/doc/src/reference/unstable.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/reference/unstable.md 2022-02-10 02:58:21.000000000 +0000
@@ -83,6 +83,7 @@
* [build-std-features](#build-std-features) — Sets features to use with the standard library.
* [binary-dep-depinfo](#binary-dep-depinfo) — Causes the dep-info file to track binary dependencies.
* [panic-abort-tests](#panic-abort-tests) — Allows running tests with the "abort" panic strategy.
+ * [crate-type](#crate-type) - Supports passing crate types to the compiler.
* rustdoc
* [`doctest-in-workspace`](#doctest-in-workspace) — Fixes workspace-relative paths when running doctests.
* [rustdoc-map](#rustdoc-map) — Provides mappings for documentation to link to external sites like [docs.rs](https://docs.rs/).
@@ -93,7 +94,6 @@
* [Build-plan](#build-plan) — Emits JSON information on which commands will be run.
* [timings](#timings) — Generates a report on how long individual dependencies took to run.
* [unit-graph](#unit-graph) — Emits JSON for Cargo's internal graph structure.
- * [future incompat report](#future-incompat-report) — Displays a report for future incompatibilities that may error in the future.
* [`cargo rustc --print`](#rustc---print) — Calls rustc with `--print` to display information from rustc.
* Configuration
* [config-cli](#config-cli) — Adds the ability to pass configuration options on the command-line.
@@ -506,7 +506,8 @@
The "custom build" units are `build.rs` scripts, which when run are
highlighted in orange.
-The second graph shows Cargo's concurrency over time. The three lines are:
+The second graph shows Cargo's concurrency over time. The background
+indicates CPU usage. The three lines are:
- "Waiting" (red) — This is the number of units waiting for a CPU slot to
open.
- "Inactive" (blue) — This is the number of units that are waiting for their
@@ -554,6 +555,23 @@
[rust-lang/rust#64158]: https://github.com/rust-lang/rust/pull/64158
+### crate-type
+* Tracking Issue: [#10083](https://github.com/rust-lang/cargo/issues/10083)
+* RFC: [#3180](https://github.com/rust-lang/rfcs/pull/3180)
+* Original Pull Request: [#10093](https://github.com/rust-lang/cargo/pull/10093)
+
+`cargo rustc --crate-type=lib,cdylib` forwards the `--crate-type` flag to `rustc`.
+This runs `rustc` with the corresponding
+[`--crate-type`](https://doc.rust-lang.org/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit)
+flag, and compiling.
+
+When using it, it requires the `-Z unstable-options`
+command-line option:
+
+```console
+cargo rustc --crate-type lib,cdylib -Z unstable-options
+```
+
### config-cli
* Tracking Issue: [#7722](https://github.com/rust-lang/cargo/issues/7722)
@@ -802,28 +820,6 @@
}
```
-### Profile `strip` option
-* Tracking Issue: [rust-lang/rust#72110](https://github.com/rust-lang/rust/issues/72110)
-
-This feature provides a new option in the `[profile]` section to strip either
-symbols or debuginfo from a binary. This can be enabled like so:
-
-```toml
-cargo-features = ["strip"]
-
-[package]
-# ...
-
-[profile.release]
-strip = "debuginfo"
-```
-
-Other possible string values of `strip` are `none`, `symbols`, and `off`. The default is `none`.
-
-You can also configure this option with the two absolute boolean values
-`true` and `false`. The former enables `strip` at its higher level, `symbols`,
-while the latter disables `strip` completely.
-
### rustdoc-map
* Tracking Issue: [#8296](https://github.com/rust-lang/cargo/issues/8296)
@@ -1124,35 +1120,6 @@
[crates.io]: https://crates.io/
[config file]: config.md
-### future incompat report
-* RFC: [#2834](https://github.com/rust-lang/rfcs/blob/master/text/2834-cargo-report-future-incompat.md)
-* rustc Tracking Issue: [#71249](https://github.com/rust-lang/rust/issues/71249)
-
-The `-Z future-incompat-report` flag causes Cargo to check for
-future-incompatible warnings in all dependencies. These are warnings for
-changes that may become hard errors in the future, causing the dependency to
-stop building in a future version of rustc. If any warnings are found, a small
-notice is displayed indicating that the warnings were found, and provides
-instructions on how to display a full report.
-
-A full report can be displayed with the `cargo report future-incompatibilities
--Z future-incompat-report --id ID` command, or by running the build again with
-the `--future-incompat-report` flag. The developer should then update their
-dependencies to a version where the issue is fixed, or work with the
-developers of the dependencies to help resolve the issue.
-
-This feature can be configured through a `[future-incompat-report]`
-section in `.cargo/config`. Currently, the supported options are:
-
-```
-[future-incompat-report]
-frequency = FREQUENCY
-```
-
-The supported values for `FREQUENCY` are 'always` and 'never', which control
-whether or not a message is printed out at the end of `cargo build` / `cargo check`.
-
-
### `cargo config`
* Original Issue: [#2362](https://github.com/rust-lang/cargo/issues/2362)
@@ -1207,7 +1174,7 @@
* Tracking Issue: [#9778](https://github.com/rust-lang/cargo/issues/9778)
* PR: [#9627](https://github.com/rust-lang/cargo/pull/9627)
-The `different-binary-name` feature allows setting the filename of the binary without having to obey the
+The `different-binary-name` feature allows setting the filename of the binary without having to obey the
restrictions placed on crate names. For example, the crate name must use only `alphanumeric` characters
or `-` or `_`, and cannot be empty.
@@ -1229,6 +1196,20 @@
path = "src/main.rs"
```
+### scrape-examples
+
+* RFC: [#3123](https://github.com/rust-lang/rfcs/pull/3123)
+* Tracking Issue: [#9910](https://github.com/rust-lang/cargo/issues/9910)
+
+The `-Z rustdoc-scrape-examples` argument tells Rustdoc to search crates in the current workspace
+for calls to functions. Those call-sites are then included as documentation. The flag can take an
+argument of `all` or `examples` which configures which crate in the workspace to analyze for examples.
+For instance:
+
+```
+cargo doc -Z unstable-options -Z rustdoc-scrape-examples=examples
+```
+
## Stabilized and removed features
### Compile progress
@@ -1378,7 +1359,19 @@
See the [`edition` field](manifest.md#the-edition-field) for more information on setting the edition.
See [`cargo fix --edition`](../commands/cargo-fix.md) and [The Edition Guide](../../edition-guide/index.html) for more information on migrating existing projects.
+
### Custom named profiles
Custom named profiles have been stabilized in the 1.57 release. See the
[profiles chapter](profiles.md#custom-profiles) for more information.
+
+### Profile `strip` option
+
+The profile `strip` option has been stabilized in the 1.59 release. See the
+[profiles chapter](profiles.md#strip) for more information.
+
+### Future incompat report
+
+Support for generating a future-incompat report has been stabilized
+in the 1.59 release. See the [future incompat report chapter](future-incompat-report.md)
+for more information.
diff -Nru cargo-0.58.0/src/doc/src/SUMMARY.md cargo-0.60.0ubuntu1/src/doc/src/SUMMARY.md
--- cargo-0.58.0/src/doc/src/SUMMARY.md 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/doc/src/SUMMARY.md 2022-02-10 02:58:21.000000000 +0000
@@ -38,6 +38,7 @@
* [Registries](reference/registries.md)
* [Dependency Resolution](reference/resolver.md)
* [SemVer Compatibility](reference/semver.md)
+ * [Future incompat report](reference/future-incompat-report.md)
* [Unstable Features](reference/unstable.md)
* [Cargo Commands](commands/index.md)
@@ -57,6 +58,7 @@
* [cargo rustc](commands/cargo-rustc.md)
* [cargo rustdoc](commands/cargo-rustdoc.md)
* [cargo test](commands/cargo-test.md)
+ * [cargo report](commands/cargo-report.md)
* [Manifest Commands](commands/manifest-commands.md)
* [cargo generate-lockfile](commands/cargo-generate-lockfile.md)
* [cargo locate-project](commands/cargo-locate-project.md)
diff -Nru cargo-0.58.0/src/etc/man/cargo.1 cargo-0.60.0ubuntu1/src/etc/man/cargo.1
--- cargo-0.58.0/src/etc/man/cargo.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo.1 2022-02-10 02:58:21.000000000 +0000
@@ -178,7 +178,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-bench.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-bench.1
--- cargo-0.58.0/src/etc/man/cargo-bench.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-bench.1 2022-02-10 02:58:21.000000000 +0000
@@ -300,7 +300,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-build.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-build.1
--- cargo-0.58.0/src/etc/man/cargo-build.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-build.1 2022-02-10 02:58:21.000000000 +0000
@@ -169,6 +169,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Build optimized artifacts with the \fBrelease\fR profile.
@@ -219,7 +220,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
@@ -359,6 +362,14 @@
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff -Nru cargo-0.58.0/src/etc/man/cargo-check.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-check.1
--- cargo-0.58.0/src/etc/man/cargo-check.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-check.1 2022-02-10 02:58:21.000000000 +0000
@@ -174,6 +174,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Check optimized artifacts with the \fBrelease\fR profile.
@@ -220,7 +221,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
@@ -349,6 +352,14 @@
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff -Nru cargo-0.58.0/src/etc/man/cargo-clean.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-clean.1
--- cargo-0.58.0/src/etc/man/cargo-clean.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-clean.1 2022-02-10 02:58:21.000000000 +0000
@@ -77,7 +77,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-doc.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-doc.1
--- cargo-0.58.0/src/etc/man/cargo-doc.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-doc.1 2022-02-10 02:58:21.000000000 +0000
@@ -147,6 +147,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Document optimized artifacts with the \fBrelease\fR profile.
@@ -187,7 +188,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-fetch.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-fetch.1
--- cargo-0.58.0/src/etc/man/cargo-fetch.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-fetch.1 2022-02-10 02:58:21.000000000 +0000
@@ -51,7 +51,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-fix.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-fix.1
--- cargo-0.58.0/src/etc/man/cargo-fix.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-fix.1 2022-02-10 02:58:21.000000000 +0000
@@ -269,6 +269,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Fix optimized artifacts with the \fBrelease\fR profile.
@@ -315,7 +316,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-generate-lockfile.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-generate-lockfile.1
--- cargo-0.58.0/src/etc/man/cargo-generate-lockfile.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-generate-lockfile.1 2022-02-10 02:58:21.000000000 +0000
@@ -29,7 +29,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-init.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-init.1
--- cargo-0.58.0/src/etc/man/cargo-init.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-init.1 2022-02-10 02:58:21.000000000 +0000
@@ -78,7 +78,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-install.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-install.1
--- cargo-0.58.0/src/etc/man/cargo-install.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-install.1 2022-02-10 02:58:21.000000000 +0000
@@ -319,7 +319,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
@@ -342,6 +344,46 @@
May also be specified with the \fBterm.color\fR
\fIconfig value\fR \&.
.RE
+.sp
+\fB\-\-message\-format\fR \fIfmt\fR
+.RS 4
+The output format for diagnostic messages. Can be specified multiple times
+and consists of comma\-separated values. Valid values:
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBhuman\fR (default): Display in a human\-readable text format. Conflicts with
+\fBshort\fR and \fBjson\fR\&.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBshort\fR: Emit shorter, human\-readable text messages. Conflicts with \fBhuman\fR
+and \fBjson\fR\&.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBjson\fR: Emit JSON messages to stdout. See
+\fIthe reference\fR
+for more details. Conflicts with \fBhuman\fR and \fBshort\fR\&.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBjson\-diagnostic\-short\fR: Ensure the \fBrendered\fR field of JSON messages contains
+the "short" rendering from rustc. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBjson\-diagnostic\-rendered\-ansi\fR: Ensure the \fBrendered\fR field of JSON messages
+contains embedded ANSI color codes for respecting rustc's default color
+scheme. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
+.RE
+.sp
+.RS 4
+\h'-04'\(bu\h'+02'\fBjson\-render\-diagnostics\fR: Instruct Cargo to not include rustc diagnostics in
+in JSON messages printed, but instead Cargo itself should render the
+JSON diagnostics coming from rustc. Cargo's own JSON diagnostics and others
+coming from rustc are still emitted. Cannot be used with \fBhuman\fR or \fBshort\fR\&.
+.RE
+.RE
.SS "Common Options"
.sp
\fB+\fR\fItoolchain\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-locate-project.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-locate-project.1
--- cargo-0.58.0/src/etc/man/cargo-locate-project.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-locate-project.1 2022-02-10 02:58:21.000000000 +0000
@@ -44,7 +44,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-login.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-login.1
--- cargo-0.58.0/src/etc/man/cargo-login.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-login.1 2022-02-10 02:58:21.000000000 +0000
@@ -42,7 +42,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-metadata.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-metadata.1
--- cargo-0.58.0/src/etc/man/cargo-metadata.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-metadata.1 2022-02-10 02:58:21.000000000 +0000
@@ -179,6 +179,8 @@
],
/* Optional string that is the default binary picked by cargo run. */
"default_run": null,
+ /* Optional string that is the minimum supported rust version */
+ "rust_version": "1.56",
/* Array of keywords from the manifest. */
"keywords": [
"cli"
@@ -350,7 +352,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-new.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-new.1
--- cargo-0.58.0/src/etc/man/cargo-new.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-new.1 2022-02-10 02:58:21.000000000 +0000
@@ -73,7 +73,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-owner.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-owner.1
--- cargo-0.58.0/src/etc/man/cargo-owner.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-owner.1 2022-02-10 02:58:21.000000000 +0000
@@ -84,7 +84,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-package.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-package.1
--- cargo-0.58.0/src/etc/man/cargo-package.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-package.1 2022-02-10 02:58:21.000000000 +0000
@@ -249,7 +249,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-pkgid.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-pkgid.1
--- cargo-0.58.0/src/etc/man/cargo-pkgid.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-pkgid.1 2022-02-10 02:58:21.000000000 +0000
@@ -84,7 +84,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-publish.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-publish.1
--- cargo-0.58.0/src/etc/man/cargo-publish.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-publish.1 2022-02-10 02:58:21.000000000 +0000
@@ -199,7 +199,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-report.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-report.1
--- cargo-0.58.0/src/etc/man/cargo-report.1 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-report.1 2022-02-10 02:58:21.000000000 +0000
@@ -0,0 +1,48 @@
+'\" t
+.TH "CARGO\-REPORT" "1"
+.nh
+.ad l
+.ss \n[.ss] 0
+.SH "NAME"
+cargo\-report \- Generate and display various kinds of reports
+.SH "SYNOPSIS"
+\fBcargo report\fR \fItype\fR [\fIoptions\fR]
+.SS "DESCRIPTION"
+Displays a report of the given \fItype\fR \- currently, only \fBfuture\-incompat\fR is supported
+.SH "OPTIONS"
+.sp
+\fB\-\-id\fR \fIid\fR
+.RS 4
+Show the report with the specified Cargo\-generated id
+.RE
+.sp
+\fB\-p\fR \fIspec\fR\&...,
+\fB\-\-package\fR \fIspec\fR\&...
+.RS 4
+Only display a report for the specified package
+.RE
+.SH "EXAMPLES"
+.sp
+.RS 4
+\h'-04' 1.\h'+01'Display the latest future\-incompat report:
+.sp
+.RS 4
+.nf
+cargo report future\-incompat
+.fi
+.RE
+.RE
+.sp
+.RS 4
+\h'-04' 2.\h'+01'Display the latest future\-incompat report for a specific package:
+.sp
+.RS 4
+.nf
+cargo report future\-incompat \-\-package my\-dep:0.0.1
+.fi
+.RE
+.RE
+.SH "SEE ALSO"
+\fIFuture incompat report\fR
+.sp
+\fBcargo\fR(1)
diff -Nru cargo-0.58.0/src/etc/man/cargo-run.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-run.1
--- cargo-0.58.0/src/etc/man/cargo-run.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-run.1 2022-02-10 02:58:21.000000000 +0000
@@ -80,6 +80,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Run optimized artifacts with the \fBrelease\fR profile.
@@ -120,7 +121,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-rustc.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-rustc.1
--- cargo-0.58.0/src/etc/man/cargo-rustc.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-rustc.1 2022-02-10 02:58:21.000000000 +0000
@@ -155,6 +155,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Build optimized artifacts with the \fBrelease\fR profile.
@@ -215,7 +216,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
@@ -344,6 +347,14 @@
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff -Nru cargo-0.58.0/src/etc/man/cargo-rustdoc.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-rustdoc.1
--- cargo-0.58.0/src/etc/man/cargo-rustdoc.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-rustdoc.1 2022-02-10 02:58:21.000000000 +0000
@@ -166,6 +166,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Document optimized artifacts with the \fBrelease\fR profile.
@@ -206,7 +207,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-search.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-search.1
--- cargo-0.58.0/src/etc/man/cargo-search.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-search.1 2022-02-10 02:58:21.000000000 +0000
@@ -45,7 +45,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-test.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-test.1
--- cargo-0.58.0/src/etc/man/cargo-test.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-test.1 2022-02-10 02:58:21.000000000 +0000
@@ -266,6 +266,7 @@
\fIbuild cache\fR documentation for more details.
.RE
.sp
+\fB\-r\fR,
\fB\-\-release\fR
.RS 4
Test optimized artifacts with the \fBrelease\fR profile.
@@ -315,7 +316,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
@@ -453,6 +456,14 @@
\fBbuild.jobs\fR \fIconfig value\fR \&. Defaults to
the number of CPUs.
.RE
+.sp
+\fB\-\-future\-incompat\-report\fR
+.RS 4
+Displays a future\-incompat report for any future\-incompatible warnings
+produced during execution of this command
+.sp
+See \fBcargo\-report\fR(1)
+.RE
.SH "ENVIRONMENT"
See \fIthe reference\fR for
details on environment variables that Cargo reads.
diff -Nru cargo-0.58.0/src/etc/man/cargo-tree.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-tree.1
--- cargo-0.58.0/src/etc/man/cargo-tree.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-tree.1 2022-02-10 02:58:21.000000000 +0000
@@ -317,7 +317,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-uninstall.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-uninstall.1
--- cargo-0.58.0/src/etc/man/cargo-uninstall.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-uninstall.1 2022-02-10 02:58:21.000000000 +0000
@@ -68,7 +68,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-update.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-update.1
--- cargo-0.58.0/src/etc/man/cargo-update.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-update.1 2022-02-10 02:58:21.000000000 +0000
@@ -69,7 +69,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-vendor.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-vendor.1
--- cargo-0.58.0/src/etc/man/cargo-vendor.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-vendor.1 2022-02-10 02:58:21.000000000 +0000
@@ -96,7 +96,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-verify-project.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-verify-project.1
--- cargo-0.58.0/src/etc/man/cargo-verify-project.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-verify-project.1 2022-02-10 02:58:21.000000000 +0000
@@ -39,7 +39,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/src/etc/man/cargo-yank.1 cargo-0.60.0ubuntu1/src/etc/man/cargo-yank.1
--- cargo-0.58.0/src/etc/man/cargo-yank.1 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/src/etc/man/cargo-yank.1 2022-02-10 02:58:21.000000000 +0000
@@ -73,7 +73,9 @@
\fB\-q\fR,
\fB\-\-quiet\fR
.RS 4
-No output printed to stdout.
+Do not print cargo log messages.
+May also be specified with the \fBterm.quiet\fR
+\fIconfig value\fR \&.
.RE
.sp
\fB\-\-color\fR \fIwhen\fR
diff -Nru cargo-0.58.0/tests/testsuite/alt_registry.rs cargo-0.60.0ubuntu1/tests/testsuite/alt_registry.rs
--- cargo-0.58.0/tests/testsuite/alt_registry.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/alt_registry.rs 2022-02-10 02:58:21.000000000 +0000
@@ -823,6 +823,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -880,6 +881,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -905,6 +907,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -930,6 +933,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -980,6 +984,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -1018,6 +1023,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -1115,6 +1121,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -1140,6 +1147,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -1178,6 +1186,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
diff -Nru cargo-0.58.0/tests/testsuite/build.rs cargo-0.60.0ubuntu1/tests/testsuite/build.rs
--- cargo-0.58.0/tests/testsuite/build.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/build.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1668,7 +1668,7 @@
}
#[cargo_test]
-/// Make sure broken symlinks don't break the build
+/// Make sure broken and loop symlinks don't break the build
///
/// This test requires you to be able to make symlinks.
/// For windows, this may require you to enable developer mode.
@@ -1681,9 +1681,17 @@
.file("Cargo.toml", &basic_bin_manifest("foo"))
.file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
.symlink("Notafile", "bar")
+ // To hit the symlink directory, we need a build script
+ // to trigger a full scan of package files.
+ .file("build.rs", &main_file(r#""build script""#, &[]))
+ .symlink_dir("a/b", "a/b/c/d/foo")
.build();
- p.cargo("build").run();
+ p.cargo("build")
+ .with_stderr_contains(
+ "[WARNING] File system loop found: [..]/a/b/c/d/foo points to an ancestor [..]/a/b",
+ )
+ .run();
assert!(p.bin("foo").is_file());
p.process(&p.bin("foo")).with_stdout("i am foo\n").run();
@@ -1707,11 +1715,6 @@
#[cargo_test]
fn lto_build() {
- // FIXME: currently this hits a linker bug on 32-bit MSVC
- if cfg!(all(target_env = "msvc", target_pointer_width = "32")) {
- return;
- }
-
let p = project()
.file(
"Cargo.toml",
@@ -1781,6 +1784,25 @@
}
#[cargo_test]
+fn verbose_release_build_short() {
+ let p = project().file("src/lib.rs", "").build();
+ p.cargo("build -v -r")
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib \
+ --emit=[..]link[..]\
+ -C opt-level=3[..]\
+ -C metadata=[..] \
+ --out-dir [..] \
+ -L dependency=[CWD]/target/release/deps`
+[FINISHED] release [optimized] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
fn verbose_release_build_deps() {
let p = project()
.file(
@@ -1900,6 +1922,40 @@
}
#[cargo_test]
+fn non_existing_test() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [lib]
+ name = "foo"
+ path = "src/lib.rs"
+
+ [[test]]
+ name = "hello"
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .build();
+
+ p.cargo("build --tests -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `hello` test at `tests/hello.rs` or `tests/hello/main.rs`. \
+ Please specify test.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
fn non_existing_example() {
let p = project()
.file(
@@ -1908,7 +1964,6 @@
[package]
name = "foo"
version = "1.0.0"
- authors = []
[lib]
name = "foo"
@@ -1921,14 +1976,49 @@
.file("src/lib.rs", "")
.build();
- p.cargo("test -v")
+ p.cargo("build --examples -v")
.with_status(101)
.with_stderr(
"\
[ERROR] failed to parse manifest at `[..]`
Caused by:
- can't find `hello` example, specify example.path",
+ can't find `hello` example at `examples/hello.rs` or `examples/hello/main.rs`. \
+ Please specify example.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn non_existing_benchmark() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [lib]
+ name = "foo"
+ path = "src/lib.rs"
+
+ [[bench]]
+ name = "hello"
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .build();
+
+ p.cargo("build --benches -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `hello` bench at `benches/hello.rs` or `benches/hello/main.rs`. \
+ Please specify bench.path if you want to use a non-default path.",
)
.run();
}
@@ -1948,7 +2038,184 @@
[ERROR] failed to parse manifest at `[..]`
Caused by:
- can't find `foo` bin, specify bin.path",
+ can't find `foo` bin at `src/bin/foo.rs` or `src/bin/foo/main.rs`. \
+ Please specify bin.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn commonly_wrong_path_of_test() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [lib]
+ name = "foo"
+ path = "src/lib.rs"
+
+ [[test]]
+ name = "foo"
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("test/foo.rs", "")
+ .build();
+
+ p.cargo("build --tests -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `foo` test at default paths, but found a file at `test/foo.rs`.
+ Perhaps rename the file to `tests/foo.rs` for target auto-discovery, \
+ or specify test.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn commonly_wrong_path_of_example() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [lib]
+ name = "foo"
+ path = "src/lib.rs"
+
+ [[example]]
+ name = "foo"
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("example/foo.rs", "")
+ .build();
+
+ p.cargo("build --examples -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `foo` example at default paths, but found a file at `example/foo.rs`.
+ Perhaps rename the file to `examples/foo.rs` for target auto-discovery, \
+ or specify example.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn commonly_wrong_path_of_benchmark() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [lib]
+ name = "foo"
+ path = "src/lib.rs"
+
+ [[bench]]
+ name = "foo"
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("bench/foo.rs", "")
+ .build();
+
+ p.cargo("build --benches -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `foo` bench at default paths, but found a file at `bench/foo.rs`.
+ Perhaps rename the file to `benches/foo.rs` for target auto-discovery, \
+ or specify bench.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn commonly_wrong_path_binary() {
+ let p = project()
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
+ .file("src/lib.rs", "")
+ .file("src/bins/foo.rs", "")
+ .build();
+
+ p.cargo("build -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `foo` bin at default paths, but found a file at `src/bins/foo.rs`.
+ Perhaps rename the file to `src/bin/foo.rs` for target auto-discovery, \
+ or specify bin.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn commonly_wrong_path_subdir_binary() {
+ let p = project()
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
+ .file("src/lib.rs", "")
+ .file("src/bins/foo/main.rs", "")
+ .build();
+
+ p.cargo("build -v")
+ .with_status(101)
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ can't find `foo` bin at default paths, but found a file at `src/bins/foo/main.rs`.
+ Perhaps rename the file to `src/bin/foo/main.rs` for target auto-discovery, \
+ or specify bin.path if you want to use a non-default path.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn found_multiple_target_files() {
+ let p = project()
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
+ .file("src/lib.rs", "")
+ .file("src/bin/foo.rs", "")
+ .file("src/bin/foo/main.rs", "")
+ .build();
+
+ p.cargo("build -v")
+ .with_status(101)
+ // Don't assert the inferred pathes since the order is non-deterministic.
+ .with_stderr(
+ "\
+[ERROR] failed to parse manifest at `[..]`
+
+Caused by:
+ cannot infer path for `foo` bin
+ Cargo doesn't know which to use because multiple target files found \
+ at `src/bin/foo[..].rs` and `src/bin/foo[..].rs`.",
)
.run();
}
@@ -4319,7 +4586,7 @@
[ERROR] failed to parse manifest at `[..]`
Caused by:
- can't find `foo` bin, specify bin.path",
+ can't find `foo` bin at `src/bin/foo.rs` or `src/bin/foo/main.rs`. [..]",
)
.run();
}
@@ -4529,7 +4796,9 @@
p.cargo("build")
.with_status(101)
- .with_stderr_contains("[..]can't find `a_bin` bin, specify bin.path")
+ .with_stderr_contains(
+ "[..]can't find `a_bin` bin at `src/bin/a_bin.rs` or `src/bin/a_bin/main.rs`[..]",
+ )
.run();
}
diff -Nru cargo-0.58.0/tests/testsuite/build_script_extra_link_arg.rs cargo-0.60.0ubuntu1/tests/testsuite/build_script_extra_link_arg.rs
--- cargo-0.58.0/tests/testsuite/build_script_extra_link_arg.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/build_script_extra_link_arg.rs 2022-02-10 02:58:21.000000000 +0000
@@ -279,3 +279,34 @@
.with_stderr_does_not_contain("--bogus")
.run();
}
+
+#[cargo_test]
+fn link_arg_with_doctest() {
+ let p = project()
+ .file(
+ "src/lib.rs",
+ r#"
+ //! ```
+ //! let x = 5;
+ //! assert_eq!(x, 5);
+ //! ```
+ "#,
+ )
+ .file(
+ "build.rs",
+ r#"
+ fn main() {
+ println!("cargo:rustc-link-arg=--this-is-a-bogus-flag");
+ }
+ "#,
+ )
+ .build();
+
+ p.cargo("test --doc -v")
+ .masquerade_as_nightly_cargo()
+ .without_status()
+ .with_stderr_contains(
+ "[RUNNING] `rustdoc [..]--crate-name foo [..]-C link-arg=--this-is-a-bogus-flag[..]",
+ )
+ .run();
+}
diff -Nru cargo-0.58.0/tests/testsuite/build_script.rs cargo-0.60.0ubuntu1/tests/testsuite/build_script.rs
--- cargo-0.58.0/tests/testsuite/build_script.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/build_script.rs 2022-02-10 02:58:21.000000000 +0000
@@ -4619,69 +4619,6 @@
}
#[cargo_test]
-#[cfg(unix)]
-fn build_script_scan_eacces() {
- // build.rs causes a scan of the whole project, which can be a problem if
- // a directory is not accessible.
- use cargo_test_support::git;
- use std::os::unix::fs::PermissionsExt;
-
- let p = project()
- .file("src/lib.rs", "")
- .file("build.rs", "fn main() {}")
- .file("secrets/stuff", "")
- .build();
- let path = p.root().join("secrets");
- fs::set_permissions(&path, fs::Permissions::from_mode(0o0)).unwrap();
- // The last "Caused by" is a string from libc such as the following:
- // Permission denied (os error 13)
- p.cargo("build")
- .with_stderr(
- "\
-[ERROR] failed to determine package fingerprint for build script for foo v0.0.1 ([..]/foo)
-
-Caused by:
- failed to determine the most recently modified file in [..]/foo
-
-Caused by:
- failed to determine list of files in [..]/foo
-
-Caused by:
- cannot read \"[..]/foo/secrets\"
-
-Caused by:
- [..]
-",
- )
- .with_status(101)
- .run();
-
- // Try `package.exclude` to skip a directory.
- p.change_file(
- "Cargo.toml",
- r#"
- [package]
- name = "foo"
- version = "0.0.1"
- exclude = ["secrets"]
- "#,
- );
- p.cargo("build").run();
-
- // Try with git. This succeeds because the git status walker ignores
- // directories it can't access.
- p.change_file("Cargo.toml", &basic_manifest("foo", "0.0.1"));
- p.build_dir().rm_rf();
- let repo = git::init(&p.root());
- git::add(&repo);
- git::commit(&repo);
- p.cargo("build").run();
-
- // Restore permissions so that the directory can be deleted.
- fs::set_permissions(&path, fs::Permissions::from_mode(0o755)).unwrap();
-}
-
-#[cargo_test]
fn dev_dep_with_links() {
let p = project()
.file(
diff -Nru cargo-0.58.0/tests/testsuite/cargo_alias_config.rs cargo-0.60.0ubuntu1/tests/testsuite/cargo_alias_config.rs
--- cargo-0.58.0/tests/testsuite/cargo_alias_config.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/cargo_alias_config.rs 2022-02-10 02:58:21.000000000 +0000
@@ -77,6 +77,38 @@
}
#[cargo_test]
+fn alias_shadowing_external_subcommand() {
+ let echo = echo_subcommand();
+ let p = project()
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
+ .file("src/main.rs", "fn main() {}")
+ .file(
+ ".cargo/config",
+ r#"
+ [alias]
+ echo = "build"
+ "#,
+ )
+ .build();
+
+ let mut paths: Vec<_> = env::split_paths(&env::var_os("PATH").unwrap_or_default()).collect();
+ paths.push(echo.target_debug_dir());
+ let path = env::join_paths(paths).unwrap();
+
+ p.cargo("echo")
+ .env("PATH", &path)
+ .with_stderr("\
+[WARNING] user-defined alias `echo` is shadowing an external subcommand found at: `[ROOT]/cargo-echo/target/debug/cargo-echo[EXE]`
+This was previously accepted but is being phased out; it will become a hard error in a future release.
+For more information, see issue #10049 .
+[COMPILING] foo v0.5.0 [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
fn default_args_alias() {
let echo = echo_subcommand();
let p = project()
@@ -100,14 +132,24 @@
p.cargo("echo")
.env("PATH", &path)
.with_status(101)
- .with_stderr("error: alias echo has unresolvable recursive definition: echo -> echo")
+ .with_stderr("\
+[WARNING] user-defined alias `echo` is shadowing an external subcommand found at: `[ROOT]/cargo-echo/target/debug/cargo-echo[EXE]`
+This was previously accepted but is being phased out; it will become a hard error in a future release.
+For more information, see issue #10049 .
+error: alias echo has unresolvable recursive definition: echo -> echo
+",
+ )
.run();
p.cargo("test-1")
.env("PATH", &path)
.with_status(101)
- .with_stderr(
- "error: alias test-1 has unresolvable recursive definition: test-1 -> echo -> echo",
+ .with_stderr("\
+[WARNING] user-defined alias `echo` is shadowing an external subcommand found at: `[ROOT]/cargo-echo/target/debug/cargo-echo[EXE]`
+This was previously accepted but is being phased out; it will become a hard error in a future release.
+For more information, see issue #10049 .
+error: alias test-1 has unresolvable recursive definition: test-1 -> echo -> echo
+",
)
.run();
diff -Nru cargo-0.58.0/tests/testsuite/cargo_command.rs cargo-0.60.0ubuntu1/tests/testsuite/cargo_command.rs
--- cargo-0.58.0/tests/testsuite/cargo_command.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/cargo_command.rs 2022-02-10 02:58:21.000000000 +0000
@@ -57,8 +57,8 @@
.build();
p.cargo("--list")
- .with_stdout_contains(" myaliasstr foo --bar")
- .with_stdout_contains(" myaliasvec foo --bar")
+ .with_stdout_contains(" myaliasstr alias: foo --bar")
+ .with_stdout_contains(" myaliasvec alias: foo --bar")
.run();
}
@@ -148,6 +148,34 @@
}
#[cargo_test]
+fn find_closest_capital_c_to_c() {
+ cargo_process("C")
+ .with_status(101)
+ .with_stderr_contains(
+ "\
+error: no such subcommand: `C`
+
+Did you mean `c`?
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn find_closest_captial_b_to_b() {
+ cargo_process("B")
+ .with_status(101)
+ .with_stderr_contains(
+ "\
+error: no such subcommand: `B`
+
+Did you mean `b`?
+",
+ )
+ .run();
+}
+
+#[cargo_test]
fn find_closest_biuld_to_build() {
cargo_process("biuld")
.with_status(101)
diff -Nru cargo-0.58.0/tests/testsuite/clean.rs cargo-0.60.0ubuntu1/tests/testsuite/clean.rs
--- cargo-0.58.0/tests/testsuite/clean.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/clean.rs 2022-02-10 02:58:21.000000000 +0000
@@ -2,9 +2,12 @@
use cargo_test_support::paths::is_symlink;
use cargo_test_support::registry::Package;
-use cargo_test_support::{basic_bin_manifest, basic_manifest, git, main_file, project, rustc_host};
+use cargo_test_support::{
+ basic_bin_manifest, basic_manifest, git, main_file, project, project_in, rustc_host,
+};
+use glob::GlobError;
use std::env;
-use std::path::Path;
+use std::path::{Path, PathBuf};
#[cargo_test]
fn cargo_clean_simple() {
@@ -87,6 +90,41 @@
}
#[cargo_test]
+fn clean_multiple_packages_in_glob_char_path() {
+ let p = project_in("[d1]")
+ .file("Cargo.toml", &basic_bin_manifest("foo"))
+ .file("src/foo.rs", &main_file(r#""i am foo""#, &[]))
+ .build();
+ let foo_path = &p.build_dir().join("debug").join("deps");
+
+ // Assert that build artifacts are produced
+ p.cargo("build").run();
+ assert_ne!(get_build_artifacts(foo_path).len(), 0);
+
+ // Assert that build artifacts are destroyed
+ p.cargo("clean -p foo").run();
+ assert_eq!(get_build_artifacts(foo_path).len(), 0);
+}
+
+fn get_build_artifacts(path: &PathBuf) -> Vec> {
+ let pattern = path.to_str().expect("expected utf-8 path");
+ let pattern = glob::Pattern::escape(pattern);
+
+ #[cfg(not(target_env = "msvc"))]
+ const FILE: &str = "foo-*";
+
+ #[cfg(target_env = "msvc")]
+ const FILE: &str = "foo.pdb";
+
+ let path = PathBuf::from(pattern).join(FILE);
+ let path = path.to_str().expect("expected utf-8 path");
+ glob::glob(path)
+ .expect("expected glob to run")
+ .into_iter()
+ .collect::>>()
+}
+
+#[cargo_test]
fn clean_release() {
let p = project()
.file(
@@ -378,7 +416,7 @@
"#,
)
.file("src/lib.rs", "")
- .file("src/main.rs", "fn main() {}")
+ .file("src/lib/some-main.rs", "fn main() {}")
.file("src/bin/other-main.rs", "fn main() {}")
.file("examples/foo-ex-rlib.rs", "")
.file("examples/foo-ex-cdylib.rs", "")
diff -Nru cargo-0.58.0/tests/testsuite/config_cli.rs cargo-0.60.0ubuntu1/tests/testsuite/config_cli.rs
--- cargo-0.58.0/tests/testsuite/config_cli.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/config_cli.rs 2022-02-10 02:58:21.000000000 +0000
@@ -39,12 +39,14 @@
jobs = 3
rustc = 'file'
[term]
+ quiet = false
verbose = false
",
);
let config = ConfigBuilder::new().build();
assert_eq!(config.get::("build.jobs").unwrap(), 3);
assert_eq!(config.get::("build.rustc").unwrap(), "file");
+ assert_eq!(config.get::("term.quiet").unwrap(), false);
assert_eq!(config.get::("term.verbose").unwrap(), false);
let config = ConfigBuilder::new()
@@ -58,6 +60,14 @@
assert_eq!(config.get::("build.jobs").unwrap(), 1);
assert_eq!(config.get::("build.rustc").unwrap(), "cli");
assert_eq!(config.get::("term.verbose").unwrap(), true);
+
+ // Setting both term.verbose and term.quiet is invalid and is tested
+ // in the run test suite.
+ let config = ConfigBuilder::new()
+ .env("CARGO_TERM_QUIET", "false")
+ .config_arg("term.quiet=true")
+ .build();
+ assert_eq!(config.get::("term.quiet").unwrap(), true);
}
#[cargo_test]
diff -Nru cargo-0.58.0/tests/testsuite/config.rs cargo-0.60.0ubuntu1/tests/testsuite/config.rs
--- cargo-0.58.0/tests/testsuite/config.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/config.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1491,7 +1491,7 @@
let profile = toml::TomlProfile {
build_override: Some(Box::new(base_settings.clone())),
package: Some(overrides),
- ..base_settings.clone()
+ ..base_settings
};
let profile_toml = ::toml::to_string(&profile).unwrap();
let roundtrip: toml::TomlProfile = ::toml::from_str(&profile_toml).unwrap();
diff -Nru cargo-0.58.0/tests/testsuite/credential_process.rs cargo-0.60.0ubuntu1/tests/testsuite/credential_process.rs
--- cargo-0.58.0/tests/testsuite/credential_process.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/credential_process.rs 2022-02-10 02:58:21.000000000 +0000
@@ -403,13 +403,16 @@
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr(
+ // FIXME: Update "Caused by" error message once rust/pull/87704 is merged.
+ // On Windows, changing to a custom executable resolver has changed the
+ // error messages.
&format!("\
[UPDATING] [..]
[ERROR] failed to execute `[..]libexec/cargo-credential-doesnotexist[EXE]` to store authentication token for registry `crates-io`
Caused by:
- {}
-", cargo_test_support::no_such_file_err_msg()),
+ [..]
+"),
)
.run();
}
diff -Nru cargo-0.58.0/tests/testsuite/cross_compile.rs cargo-0.60.0ubuntu1/tests/testsuite/cross_compile.rs
--- cargo-0.58.0/tests/testsuite/cross_compile.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/cross_compile.rs 2022-02-10 02:58:21.000000000 +0000
@@ -617,6 +617,10 @@
[COMPILING] foo v0.0.1 ([CWD])
[RUNNING] `rustc --crate-name foo [..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
+[NOTE] skipping doctests for foo v0.0.1 ([ROOT]/foo) (lib), \
+cross-compilation doctests are not yet supported
+See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile \
+for more information.
",
)
.run();
@@ -634,6 +638,10 @@
[RUNNING] `rustc --crate-name foo [..]--test[..]
[FINISHED] test [unoptimized + debuginfo] target(s) in [..]
[RUNNING] `[CWD]/target/{triple}/debug/deps/foo-[..][EXE]`
+[NOTE] skipping doctests for foo v0.0.1 ([ROOT]/foo) (lib), \
+cross-compilation doctests are not yet supported
+See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#doctest-xcompile \
+for more information.
",
triple = target
))
diff -Nru cargo-0.58.0/tests/testsuite/doc.rs cargo-0.60.0ubuntu1/tests/testsuite/doc.rs
--- cargo-0.58.0/tests/testsuite/doc.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/doc.rs 2022-02-10 02:58:21.000000000 +0000
@@ -464,8 +464,17 @@
.build();
p.cargo("doc --bin foo")
- .with_stderr(
+ // The checking/documenting lines are sometimes swapped since they run
+ // concurrently.
+ .with_stderr_unordered(
"\
+warning: output filename collision.
+The bin target `foo` in package `foo v0.0.1 ([ROOT]/foo)` \
+has the same output filename as the lib target `foo` in package `foo v0.0.1 ([ROOT]/foo)`.
+Colliding filename is: [ROOT]/foo/target/doc/foo/index.html
+The targets should have unique names.
+This is a known bug where multiple crates with the same name use
+the same path; see .
[CHECKING] foo v0.0.1 ([CWD])
[DOCUMENTING] foo v0.0.1 ([CWD])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
@@ -500,8 +509,17 @@
.build();
p.cargo("doc --bins")
- .with_stderr(
+ // The checking/documenting lines are sometimes swapped since they run
+ // concurrently.
+ .with_stderr_unordered(
"\
+warning: output filename collision.
+The bin target `foo` in package `foo v0.0.1 ([ROOT]/foo)` \
+has the same output filename as the lib target `foo` in package `foo v0.0.1 ([ROOT]/foo)`.
+Colliding filename is: [ROOT]/foo/target/doc/foo/index.html
+The targets should have unique names.
+This is a known bug where multiple crates with the same name use
+the same path; see .
[CHECKING] foo v0.0.1 ([CWD])
[DOCUMENTING] foo v0.0.1 ([CWD])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
@@ -543,7 +561,9 @@
.build();
p.cargo("doc --example ex1")
- .with_stderr(
+ // The checking/documenting lines are sometimes swapped since they run
+ // concurrently.
+ .with_stderr_unordered(
"\
[CHECKING] foo v0.0.1 ([CWD])
[DOCUMENTING] foo v0.0.1 ([CWD])
@@ -594,7 +614,9 @@
.build();
p.cargo("doc --examples")
- .with_stderr(
+ // The checking/documenting lines are sometimes swapped since they run
+ // concurrently.
+ .with_stderr_unordered(
"\
[CHECKING] foo v0.0.1 ([CWD])
[DOCUMENTING] foo v0.0.1 ([CWD])
@@ -803,7 +825,7 @@
"a/src/lib.rs",
"
/// ```
- /// ☃
+ /// `
/// ```
pub fn foo() {}
",
@@ -811,9 +833,7 @@
.build();
p.cargo("doc")
- .without_status()
- .with_stderr_contains("[..]☃")
- .with_stderr_contains(r"[..]unknown start of token: \u{2603}")
+ .with_stderr_contains("[..]unknown start of token: `")
.run();
}
@@ -1244,8 +1264,24 @@
Package::new("bar", "0.1.0").publish();
p.cargo("doc --workspace")
- .with_stderr_contains("[..] Updating `[..]` index")
- .with_stderr_contains("[..] Documenting bar v0.1.0 ([..])")
+ .with_stderr_unordered(
+ "\
+[UPDATING] [..]
+[DOWNLOADING] crates ...
+[DOWNLOADED] bar v0.1.0 (registry `dummy-registry`)
+warning: output filename collision.
+The lib target `bar` in package `bar v0.1.0` has the same output filename as \
+the lib target `bar` in package `bar v0.1.0 ([ROOT]/foo/bar)`.
+Colliding filename is: [ROOT]/foo/target/doc/bar/index.html
+The targets should have unique names.
+This is a known bug where multiple crates with the same name use
+the same path; see .
+[DOCUMENTING] bar v0.1.0
+[CHECKING] bar v0.1.0
+[DOCUMENTING] bar v0.1.0 [..]
+[FINISHED] [..]
+",
+ )
.run();
}
@@ -1309,6 +1345,31 @@
}
#[cargo_test]
+fn open_no_doc_crate() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "a"
+ version = "0.0.1"
+ authors = []
+
+ [lib]
+ doc = false
+ "#,
+ )
+ .file("src/lib.rs", "#[cfg(feature)] pub fn f();")
+ .build();
+
+ p.cargo("doc --open")
+ .env("BROWSER", "do_not_run_me")
+ .with_status(101)
+ .with_stderr_contains("error: no crates with documentation")
+ .run();
+}
+
+#[cargo_test]
fn doc_workspace_open_different_library_and_package_names() {
let p = project()
.file(
@@ -1625,6 +1686,89 @@
}
#[cargo_test]
+fn doc_json_artifacts() {
+ // Checks the output of json artifact messages.
+ let p = project()
+ .file("src/lib.rs", "")
+ .file("src/bin/somebin.rs", "fn main() {}")
+ .build();
+
+ p.cargo("doc --message-format=json")
+ .with_json_contains_unordered(
+ r#"
+{
+ "reason": "compiler-artifact",
+ "package_id": "foo 0.0.1 [..]",
+ "manifest_path": "[ROOT]/foo/Cargo.toml",
+ "target":
+ {
+ "kind": ["lib"],
+ "crate_types": ["lib"],
+ "name": "foo",
+ "src_path": "[ROOT]/foo/src/lib.rs",
+ "edition": "2015",
+ "doc": true,
+ "doctest": true,
+ "test": true
+ },
+ "profile": "{...}",
+ "features": [],
+ "filenames": ["[ROOT]/foo/target/debug/deps/libfoo-[..].rmeta"],
+ "executable": null,
+ "fresh": false
+}
+
+{
+ "reason": "compiler-artifact",
+ "package_id": "foo 0.0.1 [..]",
+ "manifest_path": "[ROOT]/foo/Cargo.toml",
+ "target":
+ {
+ "kind": ["lib"],
+ "crate_types": ["lib"],
+ "name": "foo",
+ "src_path": "[ROOT]/foo/src/lib.rs",
+ "edition": "2015",
+ "doc": true,
+ "doctest": true,
+ "test": true
+ },
+ "profile": "{...}",
+ "features": [],
+ "filenames": ["[ROOT]/foo/target/doc/foo/index.html"],
+ "executable": null,
+ "fresh": false
+}
+
+{
+ "reason": "compiler-artifact",
+ "package_id": "foo 0.0.1 [..]",
+ "manifest_path": "[ROOT]/foo/Cargo.toml",
+ "target":
+ {
+ "kind": ["bin"],
+ "crate_types": ["bin"],
+ "name": "somebin",
+ "src_path": "[ROOT]/foo/src/bin/somebin.rs",
+ "edition": "2015",
+ "doc": true,
+ "doctest": false,
+ "test": true
+ },
+ "profile": "{...}",
+ "features": [],
+ "filenames": ["[ROOT]/foo/target/doc/somebin/index.html"],
+ "executable": null,
+ "fresh": false
+}
+
+{"reason":"build-finished","success":true}
+"#,
+ )
+ .run();
+}
+
+#[cargo_test]
fn short_message_format() {
let p = project().file("src/lib.rs", BAD_INTRA_LINK_LIB).build();
p.cargo("doc --message-format=short")
@@ -2148,3 +2292,344 @@
assert!(build_doc.join("somefile").exists());
assert!(real_doc.join("somefile").exists());
}
+
+#[cargo_test]
+fn scrape_examples_basic() {
+ if !is_nightly() {
+ // -Z rustdoc-scrape-examples is unstable
+ return;
+ }
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+ "#,
+ )
+ .file("examples/ex.rs", "fn main() { foo::foo(); }")
+ .file("src/lib.rs", "pub fn foo() {}\npub fn bar() { foo(); }")
+ .build();
+
+ p.cargo("doc -Zunstable-options -Z rustdoc-scrape-examples=all")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+[..] foo v0.0.1 ([CWD])
+[..] foo v0.0.1 ([CWD])
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+
+ let doc_html = p.read_file("target/doc/foo/fn.foo.html");
+ assert!(doc_html.contains("Examples found in repository"));
+ assert!(doc_html.contains("More examples"));
+
+ // Ensure that the reverse-dependency has its sources generated
+ assert!(p.build_dir().join("doc/src/ex/ex.rs.html").exists());
+}
+
+#[cargo_test]
+fn scrape_examples_avoid_build_script_cycle() {
+ if !is_nightly() {
+ // -Z rustdoc-scrape-examples is unstable
+ return;
+ }
+
+ let p = project()
+ // package with build dependency
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+ links = "foo"
+
+ [workspace]
+ members = ["bar"]
+
+ [build-dependencies]
+ bar = {path = "bar"}
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("build.rs", "fn main(){}")
+ // dependency
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "0.0.1"
+ authors = []
+ links = "bar"
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .file("bar/build.rs", "fn main(){}")
+ .build();
+
+ p.cargo("doc --all -Zunstable-options -Z rustdoc-scrape-examples=all")
+ .masquerade_as_nightly_cargo()
+ .run();
+}
+
+#[cargo_test]
+fn scrape_examples_complex_reverse_dependencies() {
+ if !is_nightly() {
+ // -Z rustdoc-scrape-examples is unstable
+ return;
+ }
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+
+ [dev-dependencies]
+ a = {path = "a", features = ["feature"]}
+ b = {path = "b"}
+
+ [workspace]
+ members = ["b"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("examples/ex.rs", "fn main() { a::f(); }")
+ .file(
+ "a/Cargo.toml",
+ r#"
+ [package]
+ name = "a"
+ version = "0.0.1"
+ authors = []
+
+ [lib]
+ proc-macro = true
+
+ [dependencies]
+ b = {path = "../b"}
+
+ [features]
+ feature = []
+ "#,
+ )
+ .file("a/src/lib.rs", "#[cfg(feature)] pub fn f();")
+ .file(
+ "b/Cargo.toml",
+ r#"
+ [package]
+ name = "b"
+ version = "0.0.1"
+ authors = []
+ "#,
+ )
+ .file("b/src/lib.rs", "")
+ .build();
+
+ p.cargo("doc -Zunstable-options -Z rustdoc-scrape-examples=all")
+ .masquerade_as_nightly_cargo()
+ .run();
+}
+
+#[cargo_test]
+fn scrape_examples_crate_with_dash() {
+ if !is_nightly() {
+ // -Z rustdoc-scrape-examples is unstable
+ return;
+ }
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "da-sh"
+ version = "0.0.1"
+ authors = []
+ "#,
+ )
+ .file("src/lib.rs", "pub fn foo() {}")
+ .file("examples/a.rs", "fn main() { da_sh::foo(); }")
+ .build();
+
+ p.cargo("doc -Zunstable-options -Z rustdoc-scrape-examples=all")
+ .masquerade_as_nightly_cargo()
+ .run();
+
+ let doc_html = p.read_file("target/doc/da_sh/fn.foo.html");
+ assert!(doc_html.contains("Examples found in repository"));
+}
+
+#[cargo_test]
+fn scrape_examples_missing_flag() {
+ if !is_nightly() {
+ return;
+ }
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.2.4"
+ authors = []
+ "#,
+ )
+ .file("src/lib.rs", "//! These are the docs!")
+ .build();
+ p.cargo("doc -Zrustdoc-scrape-examples")
+ .masquerade_as_nightly_cargo()
+ .with_status(101)
+ .with_stderr("error: -Z rustdoc-scrape-examples must take [..] an argument")
+ .run();
+}
+
+#[cargo_test]
+fn lib_before_bin() {
+ // Checks that the library is documented before the binary.
+ // Previously they were built concurrently, which can cause issues
+ // if the bin has intra-doc links to the lib.
+ let p = project()
+ .file(
+ "src/lib.rs",
+ r#"
+ /// Hi
+ pub fn abc() {}
+ "#,
+ )
+ .file(
+ "src/bin/somebin.rs",
+ r#"
+ //! See [`foo::abc`]
+ fn main() {}
+ "#,
+ )
+ .build();
+
+ // Run check first. This just helps ensure that the test clearly shows the
+ // order of the rustdoc commands.
+ p.cargo("check").run();
+
+ // The order of output here should be deterministic.
+ p.cargo("doc -v")
+ .with_stderr(
+ "\
+[DOCUMENTING] foo [..]
+[RUNNING] `rustdoc --crate-type lib --crate-name foo src/lib.rs [..]
+[RUNNING] `rustdoc --crate-type bin --crate-name somebin src/bin/somebin.rs [..]
+[FINISHED] [..]
+",
+ )
+ .run();
+
+ // And the link should exist.
+ let bin_html = p.read_file("target/doc/somebin/index.html");
+ assert!(bin_html.contains("../foo/fn.abc.html"));
+}
+
+#[cargo_test]
+fn doc_lib_false() {
+ // doc = false for a library
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+
+ [lib]
+ doc = false
+
+ [dependencies]
+ bar = {path = "bar"}
+ "#,
+ )
+ .file("src/lib.rs", "extern crate bar;")
+ .file("src/bin/some-bin.rs", "fn main() {}")
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "0.1.0"
+
+ [lib]
+ doc = false
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .build();
+
+ p.cargo("doc")
+ .with_stderr(
+ "\
+[CHECKING] bar v0.1.0 [..]
+[CHECKING] foo v0.1.0 [..]
+[DOCUMENTING] foo v0.1.0 [..]
+[FINISHED] [..]
+",
+ )
+ .run();
+
+ assert!(!p.build_dir().join("doc/foo").exists());
+ assert!(!p.build_dir().join("doc/bar").exists());
+ assert!(p.build_dir().join("doc/some_bin").exists());
+}
+
+#[cargo_test]
+fn doc_lib_false_dep() {
+ // doc = false for a dependency
+ // Ensures that the rmeta gets produced
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+
+ [dependencies]
+ bar = { path = "bar" }
+ "#,
+ )
+ .file("src/lib.rs", "extern crate bar;")
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "0.1.0"
+
+ [lib]
+ doc = false
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .build();
+
+ p.cargo("doc")
+ .with_stderr(
+ "\
+[CHECKING] bar v0.1.0 [..]
+[DOCUMENTING] foo v0.1.0 [..]
+[FINISHED] [..]
+",
+ )
+ .run();
+
+ assert!(p.build_dir().join("doc/foo").exists());
+ assert!(!p.build_dir().join("doc/bar").exists());
+}
diff -Nru cargo-0.58.0/tests/testsuite/features_namespaced.rs cargo-0.60.0ubuntu1/tests/testsuite/features_namespaced.rs
--- cargo-0.58.0/tests/testsuite/features_namespaced.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/features_namespaced.rs 2022-02-10 02:58:21.000000000 +0000
@@ -715,6 +715,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"edition": "2015",
"links": null
}
diff -Nru cargo-0.58.0/tests/testsuite/fix.rs cargo-0.60.0ubuntu1/tests/testsuite/fix.rs
--- cargo-0.58.0/tests/testsuite/fix.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/fix.rs 2022-02-10 02:58:21.000000000 +0000
@@ -950,10 +950,6 @@
#[cargo_test]
fn prepare_for_already_on_latest_stable() {
// Stable counterpart of prepare_for_already_on_latest_unstable.
- if !is_nightly() {
- // Remove once 1.56 is stabilized.
- return;
- }
if Edition::LATEST_UNSTABLE.is_some() {
eprintln!("This test cannot run while the latest edition is unstable, skipping.");
return;
@@ -1528,10 +1524,6 @@
#[cargo_test]
fn fix_edition_2021() {
// Can migrate 2021, even when lints are allowed.
- if !is_nightly() {
- // Remove once 1.56 is stabilized.
- return;
- }
let p = project()
.file(
"Cargo.toml",
@@ -1748,10 +1740,6 @@
#[cargo_test]
fn non_edition_lint_migration() {
// Migrating to a new edition where a non-edition lint causes problems.
- if !is_nightly() {
- // Remove once force-warn hits stable.
- return;
- }
let p = project()
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
.file(
diff -Nru cargo-0.58.0/tests/testsuite/future_incompat_report.rs cargo-0.60.0ubuntu1/tests/testsuite/future_incompat_report.rs
--- cargo-0.58.0/tests/testsuite/future_incompat_report.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/future_incompat_report.rs 2022-02-10 02:58:21.000000000 +0000
@@ -25,7 +25,7 @@
}
#[cargo_test]
-fn no_output_on_stable() {
+fn output_on_stable() {
if !is_nightly() {
// -Zfuture-incompat-test requires nightly (permanently)
return;
@@ -33,39 +33,23 @@
let p = simple_project();
p.cargo("check")
- // Even though rustc emits the report, cargo ignores it without -Z.
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
- .with_stderr_does_not_contain("[..]cargo report[..]")
+ .with_stderr_contains("[..]cargo report[..]")
.run();
}
+// This feature is stable, and should not be gated
#[cargo_test]
-fn gate_future_incompat_report() {
+fn no_gate_future_incompat_report() {
let p = simple_project();
p.cargo("build --future-incompat-report")
- .with_stderr_contains("error: the `--future-incompat-report` flag is unstable[..]")
- .with_status(101)
- .run();
-
- // Both `-Z future-incompat-report` and `-Z unstable-opts` are required
- p.cargo("build --future-incompat-report -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
- .with_stderr_contains("error: the `--future-incompat-report` flag is unstable[..]")
- .with_status(101)
- .run();
-
- p.cargo("build --future-incompat-report -Z unstable-options")
- .masquerade_as_nightly_cargo()
- .with_stderr_contains(
- "error: Usage of `--future-incompat-report` requires `-Z future-incompat-report`",
- )
- .with_status(101)
+ .with_status(0)
.run();
p.cargo("report future-incompatibilities --id foo")
- .with_stderr_contains("error: `cargo report` can only be used on the nightly channel")
+ .with_stderr_contains("error: no reports are currently available")
.with_status(101)
.run();
}
@@ -83,8 +67,7 @@
.build();
// No note if --future-incompat-report is not specified.
- p.cargo("build -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo("build")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr(
"\
@@ -94,8 +77,7 @@
)
.run();
- p.cargo("build --future-incompat-report -Z unstable-options -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo("build --future-incompat-report")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr(
"\
@@ -117,8 +99,7 @@
for command in &["build", "check", "rustc", "test"] {
let check_has_future_compat = || {
- p.cargo(command).arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command)
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: foo v0.0.0 [..]")
@@ -147,8 +128,6 @@
",
);
p.cargo(command)
- .arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
.with_stderr_does_not_contain("[..]rejected[..]")
@@ -156,12 +135,11 @@
.run();
// Check that passing `--future-incompat-report` overrides `frequency = 'never'`
- p.cargo(command).arg("-Zfuture-incompat-report").arg("-Zunstable-options").arg("--future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command).arg("--future-incompat-report")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains(FUTURE_OUTPUT)
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: foo v0.0.0 [..]")
- .with_stderr_contains("The package `foo v0.0.0 ([..])` currently triggers the following future incompatibility lints:")
+ .with_stderr_contains(" - foo:0.0.0[..]")
.run();
}
}
@@ -197,29 +175,41 @@
.build();
for command in &["build", "check", "rustc", "test"] {
- p.cargo(command).arg("-Zfuture-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command)
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_does_not_contain(FUTURE_OUTPUT)
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: first-dep v0.0.1, second-dep v0.0.2")
- // Check that we don't have the 'triggers' message shown at the bottom of this loop
+ // Check that we don't have the 'triggers' message shown at the bottom of this loop,
+ // and that we don't explain how to show a per-package report
.with_stderr_does_not_contain("[..]triggers[..]")
+ .with_stderr_does_not_contain("[..]--package[..]")
+ .with_stderr_does_not_contain("[..]-p[..]")
.run();
- p.cargo(command).arg("-Zunstable-options").arg("-Zfuture-incompat-report").arg("--future-incompat-report")
- .masquerade_as_nightly_cargo()
+ p.cargo(command).arg("--future-incompat-report")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: first-dep v0.0.1, second-dep v0.0.2")
- .with_stderr_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
- .with_stderr_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
+ .with_stderr_contains(" - first-dep:0.0.1")
+ .with_stderr_contains(" - second-dep:0.0.2")
+ .run();
+
+ p.cargo("report future-incompatibilities").arg("--package").arg("first-dep:0.0.1")
+ .with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
+ .with_stdout_contains(FUTURE_OUTPUT)
+ .with_stdout_does_not_contain("[..]second-dep-0.0.2/src[..]")
+ .run();
+
+ p.cargo("report future-incompatibilities").arg("--package").arg("second-dep:0.0.2")
+ .with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
+ .with_stdout_contains(FUTURE_OUTPUT)
+ .with_stdout_does_not_contain("[..]first-dep-0.0.1/src[..]")
.run();
}
// Test that passing the correct id via '--id' doesn't generate a warning message
let output = p
- .cargo("build -Z future-incompat-report")
+ .cargo("build")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
- .masquerade_as_nightly_cargo()
.exec_with_output()
.unwrap();
@@ -239,16 +229,14 @@
// Strip off the trailing '`' included in the output
let id: String = id.chars().take_while(|c| *c != '`').collect();
- p.cargo(&format!("report future-incompatibilities -Z future-incompat-report --id {}", id))
- .masquerade_as_nightly_cargo()
+ p.cargo(&format!("report future-incompatibilities --id {}", id))
.with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
.with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
.run();
// Test without --id, and also the full output of the report.
let output = p
- .cargo("report future-incompat -Z future-incompat-report")
- .masquerade_as_nightly_cargo()
+ .cargo("report future-incompat")
.exec_with_output()
.unwrap();
let output = std::str::from_utf8(&output.stdout).unwrap();
@@ -263,7 +251,9 @@
"The package `{}` currently triggers the following future incompatibility lints:",
expected
),
- lines.next().unwrap()
+ lines.next().unwrap(),
+ "Bad output:\n{}",
+ output
);
let mut count = 0;
while let Some(line) = lines.next() {
@@ -286,17 +276,17 @@
let p = simple_project();
- p.cargo("check -Zfuture-incompat-report")
+ p.cargo("check")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.masquerade_as_nightly_cargo()
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report")
+ p.cargo("report future-incompatibilities")
.masquerade_as_nightly_cargo()
.with_stdout_does_not_contain("[..]\x1b[[..]")
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report")
+ p.cargo("report future-incompatibilities")
.masquerade_as_nightly_cargo()
.env("CARGO_TERM_COLOR", "always")
.with_stdout_contains("[..]\x1b[[..]")
@@ -312,24 +302,24 @@
let p = simple_project();
- p.cargo("report future-incompatibilities -Z future-incompat-report --id 1")
+ p.cargo("report future-incompatibilities --id 1")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr("error: no reports are currently available")
.run();
- p.cargo("check -Zfuture-incompat-report")
+ p.cargo("check")
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.masquerade_as_nightly_cargo()
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report --id foo")
+ p.cargo("report future-incompatibilities --id foo")
.masquerade_as_nightly_cargo()
.with_status(1)
.with_stderr("error: Invalid value: could not parse `foo` as a number")
.run();
- p.cargo("report future-incompatibilities -Z future-incompat-report --id 7")
+ p.cargo("report future-incompatibilities --id 7")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr(
@@ -383,6 +373,9 @@
Package::new("with_updates", "1.0.2")
.file("src/lib.rs", "")
.publish();
+ Package::new("with_updates", "3.0.1")
+ .file("src/lib.rs", "")
+ .publish();
Package::new("big_update", "2.0.0")
.file("src/lib.rs", "")
.publish();
@@ -396,22 +389,22 @@
// in a long while?).
p.cargo("update -p without_updates").run();
- p.cargo("check -Zfuture-incompat-report")
+ let update_message = "\
+- Some affected dependencies have newer versions available.
+You may want to consider updating them to a newer version to see if the issue has been fixed.
+
+big_update v1.0.0 has the following newer versions available: 2.0.0
+with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2, 3.0.1
+";
+
+ p.cargo("check --future-incompat-report")
.masquerade_as_nightly_cargo()
.env("RUSTFLAGS", "-Zfuture-incompat-test")
- .with_stderr_contains("[..]cargo report future-incompatibilities --id 1[..]")
+ .with_stderr_contains(update_message)
.run();
p.cargo("report future-incompatibilities")
.masquerade_as_nightly_cargo()
- .with_stdout_contains(
- "\
-The following packages appear to have newer versions available.
-You may want to consider updating them to a newer version to see if the issue has been fixed.
-
-big_update v1.0.0 has the following newer versions available: 2.0.0
-with_updates v1.0.0 has the following newer versions available: 1.0.1, 1.0.2
-",
- )
- .run();
+ .with_stdout_contains(update_message)
+ .run()
}
diff -Nru cargo-0.58.0/tests/testsuite/git.rs cargo-0.60.0ubuntu1/tests/testsuite/git.rs
--- cargo-0.58.0/tests/testsuite/git.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/git.rs 2022-02-10 02:58:21.000000000 +0000
@@ -3147,6 +3147,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -3185,6 +3186,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
diff -Nru cargo-0.58.0/tests/testsuite/help.rs cargo-0.60.0ubuntu1/tests/testsuite/help.rs
--- cargo-0.58.0/tests/testsuite/help.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/help.rs 2022-02-10 02:58:21.000000000 +0000
@@ -110,6 +110,20 @@
assert_eq!(stdout, contents);
}
+fn help_with_stdout_and_path(subcommand: &str, path: &Path) -> String {
+ let output = process(&cargo_exe())
+ .arg("help")
+ .arg(subcommand)
+ .env("PATH", path)
+ .exec_with_output()
+ .unwrap();
+ assert!(output.status.success());
+ let stderr = from_utf8(&output.stderr).unwrap();
+ assert_eq!(stderr, "");
+ let stdout = from_utf8(&output.stdout).unwrap();
+ stdout.to_string()
+}
+
#[cargo_test]
fn help_man() {
// Checks that `help command` displays the man page using the given command.
@@ -132,11 +146,25 @@
config,
r#"
[alias]
- my-alias = ["build", "--release"]
+ empty-alias = ""
+ simple-alias = "build"
+ complex-alias = ["build", "--release"]
"#,
)
.unwrap();
- help_with_man_and_path("", "my-alias", "build", Path::new(""));
+
+ // The `empty-alias` returns an error.
+ cargo_process("help empty-alias")
+ .env("PATH", Path::new(""))
+ .with_stderr_contains("[..]The subcommand 'empty-alias' wasn't recognized[..]")
+ .run_expect_error();
+
+ // Because `simple-alias` aliases a subcommand with no arguments, help shows the manpage.
+ help_with_man_and_path("", "simple-alias", "build", Path::new(""));
+
+ // Help for `complex-alias` displays the full alias command.
+ let out = help_with_stdout_and_path("complex-alias", Path::new(""));
+ assert_eq!(out, "`complex-alias` is aliased to `build --release`\n");
}
#[cargo_test]
diff -Nru cargo-0.58.0/tests/testsuite/install.rs cargo-0.60.0ubuntu1/tests/testsuite/install.rs
--- cargo-0.58.0/tests/testsuite/install.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/install.rs 2022-02-10 02:58:21.000000000 +0000
@@ -55,6 +55,83 @@
}
#[cargo_test]
+fn simple_with_message_format() {
+ pkg("foo", "0.0.1");
+
+ cargo_process("install foo --message-format=json")
+ .with_stderr(
+ "\
+[UPDATING] `[..]` index
+[DOWNLOADING] crates ...
+[DOWNLOADED] foo v0.0.1 (registry [..])
+[INSTALLING] foo v0.0.1
+[COMPILING] foo v0.0.1
+[FINISHED] release [optimized] target(s) in [..]
+[INSTALLING] [CWD]/home/.cargo/bin/foo[EXE]
+[INSTALLED] package `foo v0.0.1` (executable `foo[EXE]`)
+[WARNING] be sure to add `[..]` to your PATH to be able to run the installed binaries
+",
+ )
+ .with_json(
+ r#"
+ {
+ "reason": "compiler-artifact",
+ "package_id": "foo 0.0.1 ([..])",
+ "manifest_path": "[..]",
+ "target": {
+ "kind": [
+ "lib"
+ ],
+ "crate_types": [
+ "lib"
+ ],
+ "name": "foo",
+ "src_path": "[..]/foo-0.0.1/src/lib.rs",
+ "edition": "2015",
+ "doc": true,
+ "doctest": true,
+ "test": true
+ },
+ "profile": "{...}",
+ "features": [],
+ "filenames": "{...}",
+ "executable": null,
+ "fresh": false
+ }
+
+ {
+ "reason": "compiler-artifact",
+ "package_id": "foo 0.0.1 ([..])",
+ "manifest_path": "[..]",
+ "target": {
+ "kind": [
+ "bin"
+ ],
+ "crate_types": [
+ "bin"
+ ],
+ "name": "foo",
+ "src_path": "[..]/foo-0.0.1/src/main.rs",
+ "edition": "2015",
+ "doc": true,
+ "doctest": false,
+ "test": true
+ },
+ "profile": "{...}",
+ "features": [],
+ "filenames": "{...}",
+ "executable": "[..]",
+ "fresh": false
+ }
+
+ {"reason":"build-finished","success":true}
+ "#,
+ )
+ .run();
+ assert_has_installed_exe(cargo_home(), "foo");
+}
+
+#[cargo_test]
fn with_index() {
pkg("foo", "0.0.1");
diff -Nru cargo-0.58.0/tests/testsuite/login.rs cargo-0.60.0ubuntu1/tests/testsuite/login.rs
--- cargo-0.58.0/tests/testsuite/login.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/login.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1,9 +1,7 @@
//! Tests for the `cargo login` command.
-use cargo::core::Shell;
-use cargo::util::config::Config;
use cargo_test_support::install::cargo_home;
-use cargo_test_support::registry::{self, registry_url};
+use cargo_test_support::registry;
use cargo_test_support::{cargo_process, paths, t};
use std::fs::{self, OpenOptions};
use std::io::prelude::*;
@@ -18,11 +16,6 @@
setup_new_credentials_at(config);
}
-fn setup_new_credentials_toml() {
- let config = cargo_home().join("credentials.toml");
- setup_new_credentials_at(config);
-}
-
fn setup_new_credentials_at(config: PathBuf) {
t!(fs::create_dir_all(config.parent().unwrap()));
t!(fs::write(
@@ -67,83 +60,6 @@
}
#[cargo_test]
-fn login_with_old_credentials() {
- registry::init();
-
- cargo_process("login --host")
- .arg(registry_url().to_string())
- .arg(TOKEN)
- .run();
-
- // Ensure that we get the new token for the registry
- assert!(check_token(TOKEN, None));
-}
-
-#[cargo_test]
-fn login_with_new_credentials() {
- registry::init();
- setup_new_credentials();
-
- cargo_process("login --host")
- .arg(registry_url().to_string())
- .arg(TOKEN)
- .run();
-
- // Ensure that we get the new token for the registry
- assert!(check_token(TOKEN, None));
-}
-
-#[cargo_test]
-fn credentials_work_with_extension() {
- registry::init();
- setup_new_credentials_toml();
-
- cargo_process("login --host")
- .arg(registry_url().to_string())
- .arg(TOKEN)
- .run();
-
- // Ensure that we get the new token for the registry
- assert!(check_token(TOKEN, None));
-}
-
-#[cargo_test]
-fn login_with_old_and_new_credentials() {
- setup_new_credentials();
- login_with_old_credentials();
-}
-
-#[cargo_test]
-fn login_without_credentials() {
- registry::init();
- cargo_process("login --host")
- .arg(registry_url().to_string())
- .arg(TOKEN)
- .run();
-
- // Ensure that we get the new token for the registry
- assert!(check_token(TOKEN, None));
-}
-
-#[cargo_test]
-fn new_credentials_is_used_instead_old() {
- registry::init();
- setup_new_credentials();
-
- cargo_process("login --host")
- .arg(registry_url().to_string())
- .arg(TOKEN)
- .run();
-
- let mut config = Config::new(Shell::new(), cargo_home(), cargo_home());
- let _ = config.values();
- let _ = config.load_credentials();
-
- let token = config.get_string("registry.token").unwrap().map(|p| p.val);
- assert_eq!(token.unwrap(), TOKEN);
-}
-
-#[cargo_test]
fn registry_credentials() {
registry::alt_init();
diff -Nru cargo-0.58.0/tests/testsuite/lto.rs cargo-0.60.0ubuntu1/tests/testsuite/lto.rs
--- cargo-0.58.0/tests/testsuite/lto.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/lto.rs 2022-02-10 02:58:21.000000000 +0000
@@ -177,7 +177,7 @@
)
.file("build.rs", "fn main() { dep_build::foo() }")
.file(
- "src/main.rs",
+ "src/bin/foo-bin.rs",
"#[dep_proc_macro::foo] fn main() { dep_normal::foo() }",
)
.file(
@@ -206,7 +206,9 @@
.with_stderr_contains(
"[..]`rustc[..]--crate-name dep_proc_macro [..]-C embed-bitcode=no[..]`",
)
- .with_stderr_contains("[..]`rustc[..]--crate-name test [..]--crate-type bin[..]-C lto[..]`")
+ .with_stderr_contains(
+ "[..]`rustc[..]--crate-name foo_bin [..]--crate-type bin[..]-C lto[..]`",
+ )
.with_stderr_contains(
"[..]`rustc[..]--crate-name test [..]--crate-type cdylib[..]-C lto[..]`",
)
@@ -753,7 +755,7 @@
"#,
)
.file("src/lib.rs", "pub fn foo() { println!(\"hi!\"); }")
- .file("src/main.rs", "fn main() { foo::foo(); }")
+ .file("src/bin/ferret.rs", "fn main() { foo::foo(); }")
.build();
let output = p.cargo("build --release -v").exec_with_output().unwrap();
@@ -763,7 +765,7 @@
"--crate-type dylib --crate-type rlib",
Lto::ObjectAndBitcode,
);
- verify_lto(&output, "foo", "--crate-type bin", Lto::Run(None));
+ verify_lto(&output, "ferret", "--crate-type bin", Lto::Run(None));
}
#[cargo_test]
diff -Nru cargo-0.58.0/tests/testsuite/metadata.rs cargo-0.60.0ubuntu1/tests/testsuite/metadata.rs
--- cargo-0.58.0/tests/testsuite/metadata.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/metadata.rs 2022-02-10 02:58:21.000000000 +0000
@@ -37,6 +37,7 @@
"description": null,
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"homepage": null,
@@ -128,6 +129,7 @@
"homepage": null,
"documentation": null,
"version": "0.5.0",
+ "rust_version": null,
"id": "foo[..]",
"keywords": [],
"source": null,
@@ -213,6 +215,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.5.0",
@@ -342,6 +345,7 @@
"name": "bar",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": "registry+https://github.com/rust-lang/crates.io-index",
@@ -382,6 +386,7 @@
"name": "baz",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": "registry+https://github.com/rust-lang/crates.io-index",
@@ -447,6 +452,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": null,
@@ -487,6 +493,7 @@
"name": "foobar",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": "registry+https://github.com/rust-lang/crates.io-index",
@@ -617,6 +624,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.1.0",
@@ -711,6 +719,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.1.0",
@@ -814,6 +823,7 @@
"id": "bar[..]",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"keywords": [],
@@ -850,6 +860,7 @@
"name": "baz",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.5.0",
@@ -943,6 +954,7 @@
"name": "bar",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.5.0",
@@ -981,6 +993,7 @@
"name": "baz",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.5.0",
@@ -1073,6 +1086,7 @@
"publish": null,
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null
}],
@@ -1235,6 +1249,7 @@
"name": "foo",
"readme": "README.md",
"repository": "https://github.com/rust-lang/cargo",
+ "rust_version": null,
"homepage": "https://rust-lang.org",
"documentation": "https://doc.rust-lang.org/stable/std/",
"version": "0.1.0",
@@ -1313,6 +1328,7 @@
"name": "foo",
"readme": "README.md",
"repository": "https://github.com/rust-lang/cargo",
+ "rust_version": null,
"homepage": null,
"documentation": null,
"version": "0.1.0",
@@ -1400,6 +1416,7 @@
"name": "bar",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": null,
@@ -1487,6 +1504,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": null,
@@ -1556,6 +1574,26 @@
}
#[cargo_test]
+fn package_rust_version() {
+ let p = project()
+ .file("src/lib.rs", "")
+ .file(
+ "Cargo.toml",
+ r#"
+ [project]
+ name = "foo"
+ version = "0.1.0"
+ authors = ["wycats@example.com"]
+ edition = "2018"
+ rust-version = "1.56"
+ "#,
+ )
+ .build();
+ let json = p.cargo("metadata").run_json();
+ assert_eq!(json["packages"][0]["rust_version"], json!("1.56"));
+}
+
+#[cargo_test]
fn target_edition_2018() {
let p = project()
.file("src/lib.rs", "")
@@ -1600,6 +1638,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": null,
@@ -1706,6 +1745,7 @@
"name": "bar",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": "registry+https://github.com/rust-lang/crates.io-index",
@@ -1746,6 +1786,7 @@
"name": "bar",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": "registry+https://github.com/rust-lang/crates.io-index",
@@ -1811,6 +1852,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": null,
@@ -1932,6 +1974,7 @@
"name": "foo",
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"source": null,
@@ -2064,6 +2107,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -2168,6 +2212,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -2211,6 +2256,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -2254,6 +2300,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -2297,6 +2344,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
@@ -2403,6 +2451,7 @@
"keywords": [],
"readme": null,
"repository": null,
+ "rust_version": null,
"homepage": null,
"documentation": null,
"edition": "2015",
diff -Nru cargo-0.58.0/tests/testsuite/new.rs cargo-0.60.0ubuntu1/tests/testsuite/new.rs
--- cargo-0.58.0/tests/testsuite/new.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/new.rs 2022-02-10 02:58:21.000000000 +0000
@@ -377,10 +377,6 @@
#[cargo_test]
fn lockfile_constant_during_new() {
- if !cargo_test_support::is_nightly() {
- // Remove when 1.56 is stable (cargo new defaults to 2021).
- return;
- }
cargo_process("new foo").run();
cargo_process("build").cwd(&paths::root().join("foo")).run();
diff -Nru cargo-0.58.0/tests/testsuite/package.rs cargo-0.60.0ubuntu1/tests/testsuite/package.rs
--- cargo-0.58.0/tests/testsuite/package.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/package.rs 2022-02-10 02:58:21.000000000 +0000
@@ -794,7 +794,7 @@
.with_status(101)
.with_stderr_contains(
"\
-error: failed to prepare local package for uploading
+[ERROR] failed to prepare local package for uploading
Caused by:
failed to open for archiving: `[..]foo.rs`
@@ -827,6 +827,27 @@
}
#[cargo_test]
+/// Tests if a symlink to ancestor causes filesystem loop error.
+///
+/// This test requires you to be able to make symlinks.
+/// For windows, this may require you to enable developer mode.
+fn filesystem_loop() {
+ if !symlink_supported() {
+ return;
+ }
+
+ project()
+ .file("src/main.rs", r#"fn main() { println!("hello"); }"#)
+ .symlink_dir("a/b", "a/b/c/d/foo")
+ .build()
+ .cargo("package -v")
+ .with_stderr_contains(
+ "[WARNING] File system loop found: [..]/a/b/c/d/foo points to an ancestor [..]/a/b",
+ )
+ .run();
+}
+
+#[cargo_test]
fn do_not_package_if_repository_is_dirty() {
let p = project().build();
@@ -1798,7 +1819,8 @@
.build();
p.cargo("package")
- .with_stderr(
+ // use unordered here because the order of the warning is different on each platform.
+ .with_stderr_unordered(
"\
[WARNING] file src/aux/mod.rs is a reserved Windows filename, it will not work on Windows platforms
[WARNING] file src/con.rs is a reserved Windows filename, it will not work on Windows platforms
diff -Nru cargo-0.58.0/tests/testsuite/patch.rs cargo-0.60.0ubuntu1/tests/testsuite/patch.rs
--- cargo-0.58.0/tests/testsuite/patch.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/patch.rs 2022-02-10 02:58:21.000000000 +0000
@@ -358,10 +358,10 @@
"\
[UPDATING] `dummy-registry` index
[WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[DOWNLOADING] crates ...
[DOWNLOADED] bar v0.1.0 [..]
[COMPILING] bar v0.1.0
@@ -374,10 +374,10 @@
.with_stderr(
"\
[WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[FINISHED] [..]
",
)
@@ -395,6 +395,60 @@
}
#[cargo_test]
+fn unused_with_mismatch_source_being_patched() {
+ registry::alt_init();
+ Package::new("bar", "0.1.0").publish();
+
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+
+ [dependencies]
+ bar = "0.1.0"
+
+ [patch.alternative]
+ bar = { path = "bar" }
+
+ [patch.crates-io]
+ bar = { path = "baz" }
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("bar/Cargo.toml", &basic_manifest("bar", "0.2.0"))
+ .file("bar/src/lib.rs", "not rust code")
+ .file("baz/Cargo.toml", &basic_manifest("bar", "0.3.0"))
+ .file("baz/src/lib.rs", "not rust code")
+ .build();
+
+ p.cargo("build")
+ .with_stderr(
+ "\
+[UPDATING] `dummy-registry` index
+[WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph.
+Perhaps you misspell the source URL being patched.
+Possible URLs for `[patch.]`:
+ crates-io
+[WARNING] Patch `bar v0.3.0 ([CWD]/baz)` was not used in the crate graph.
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
+[DOWNLOADING] crates ...
+[DOWNLOADED] bar v0.1.0 [..]
+[COMPILING] bar v0.1.0
+[COMPILING] foo v0.0.1 ([CWD])
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
fn prefer_patch_version() {
Package::new("bar", "0.1.2").publish();
@@ -477,10 +531,10 @@
"\
[UPDATING] `dummy-registry` index
[WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[DOWNLOADING] crates ...
[DOWNLOADED] bar v0.1.0 [..]
[COMPILING] bar v0.1.0
@@ -493,10 +547,10 @@
.with_stderr(
"\
[WARNING] Patch `bar v0.2.0 ([CWD]/bar)` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[FINISHED] [..]
",
)
@@ -550,10 +604,10 @@
[UPDATING] git repository `file://[..]`
[UPDATING] `dummy-registry` index
[WARNING] Patch `bar v0.2.0 ([..])` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[DOWNLOADING] crates ...
[DOWNLOADED] bar v0.1.0 [..]
[COMPILING] bar v0.1.0
@@ -566,10 +620,10 @@
.with_stderr(
"\
[WARNING] Patch `bar v0.2.0 ([..])` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[FINISHED] [..]
",
)
@@ -752,10 +806,10 @@
.with_stderr(
"\
[WARNING] Patch `bar v0.1.1 ([CWD]/bar)` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]",
)
.run();
@@ -763,10 +817,10 @@
.with_stderr(
"\
[WARNING] Patch `bar v0.1.1 ([CWD]/bar)` was not used in the crate graph.
-[..]
-[..]
-[..]
-[..]
+Check that [..]
+with the [..]
+what is [..]
+version. [..]
[FINISHED] [..]",
)
.run();
@@ -1714,10 +1768,9 @@
.with_stderr(
"\
warning: Patch `bar v0.1.1 [..]` was not used in the crate graph.
-Check that [..]
-with the [..]
-what is [..]
-version. [..]
+Perhaps you misspell the source URL being patched.
+Possible URLs for `[patch.]`:
+ [CWD]/bar
[FINISHED] [..]",
)
.run();
@@ -1769,10 +1822,9 @@
.with_stderr(
"\
warning: Patch `bar v0.1.0 [..]` was not used in the crate graph.
-Check that [..]
-with the [..]
-what is [..]
-version. [..]
+Perhaps you misspell the source URL being patched.
+Possible URLs for `[patch.]`:
+ [CWD]/bar
[FINISHED] [..]",
)
.run();
diff -Nru cargo-0.58.0/tests/testsuite/profiles.rs cargo-0.60.0ubuntu1/tests/testsuite/profiles.rs
--- cargo-0.58.0/tests/testsuite/profiles.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/profiles.rs 2022-02-10 02:58:21.000000000 +0000
@@ -472,7 +472,7 @@
#[cargo_test]
fn strip_works() {
if !is_nightly() {
- // -Zstrip is unstable
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
return;
}
@@ -480,8 +480,6 @@
.file(
"Cargo.toml",
r#"
- cargo-features = ["strip"]
-
[package]
name = "foo"
version = "0.1.0"
@@ -494,11 +492,10 @@
.build();
p.cargo("build --release -v")
- .masquerade_as_nightly_cargo()
.with_stderr(
"\
[COMPILING] foo [..]
-[RUNNING] `rustc [..] -Z strip=symbols [..]`
+[RUNNING] `rustc [..] -C strip=symbols [..]`
[FINISHED] [..]
",
)
@@ -506,52 +503,9 @@
}
#[cargo_test]
-fn strip_requires_cargo_feature() {
- if !is_nightly() {
- // -Zstrip is unstable
- return;
- }
-
- let p = project()
- .file(
- "Cargo.toml",
- r#"
- [package]
- name = "foo"
- version = "0.1.0"
-
- [profile.release]
- strip = 'symbols'
- "#,
- )
- .file("src/main.rs", "fn main() {}")
- .build();
-
- p.cargo("build --release -v")
- .masquerade_as_nightly_cargo()
- .with_status(101)
- .with_stderr(
- "\
-[ERROR] failed to parse manifest at `[CWD]/Cargo.toml`
-
-Caused by:
- feature `strip` is required
-
- The package requires the Cargo feature called `strip`, but that feature is \
- not stabilized in this version of Cargo (1.[..]).
- Consider adding `cargo-features = [\"strip\"]` to the top of Cargo.toml \
- (above the [package] table) to tell Cargo you are opting in to use this unstable feature.
- See https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#profile-strip-option \
- for more information about the status of this feature.
-",
- )
- .run();
-}
-
-#[cargo_test]
fn strip_passes_unknown_option_to_rustc() {
if !is_nightly() {
- // -Zstrip is unstable
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
return;
}
@@ -559,8 +513,6 @@
.file(
"Cargo.toml",
r#"
- cargo-features = ["strip"]
-
[package]
name = "foo"
version = "0.1.0"
@@ -573,13 +525,12 @@
.build();
p.cargo("build --release -v")
- .masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr_contains(
"\
[COMPILING] foo [..]
-[RUNNING] `rustc [..] -Z strip=unknown [..]`
-error: incorrect value `unknown` for debugging option `strip` - either `none`, `debuginfo`, or `symbols` was expected
+[RUNNING] `rustc [..] -C strip=unknown [..]`
+error: incorrect value `unknown` for [..] `strip` [..] was expected
",
)
.run();
@@ -588,7 +539,7 @@
#[cargo_test]
fn strip_accepts_true_to_strip_symbols() {
if !is_nightly() {
- // -Zstrip is unstable
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
return;
}
@@ -596,8 +547,6 @@
.file(
"Cargo.toml",
r#"
- cargo-features = ["strip"]
-
[package]
name = "foo"
version = "0.1.0"
@@ -610,11 +559,10 @@
.build();
p.cargo("build --release -v")
- .masquerade_as_nightly_cargo()
.with_stderr(
"\
[COMPILING] foo [..]
-[RUNNING] `rustc [..] -Z strip=symbols [..]`
+[RUNNING] `rustc [..] -C strip=symbols [..]`
[FINISHED] [..]
",
)
@@ -624,15 +572,14 @@
#[cargo_test]
fn strip_accepts_false_to_disable_strip() {
if !is_nightly() {
- // -Zstrip is unstable
+ // rustc 1.58 stabilized -C strip; disable the test until that ships.
return;
}
+
let p = project()
.file(
"Cargo.toml",
r#"
- cargo-features = ["strip"]
-
[package]
name = "foo"
version = "0.1.0"
@@ -645,7 +592,6 @@
.build();
p.cargo("build --release -v")
- .masquerade_as_nightly_cargo()
- .with_stderr_does_not_contain("-Z strip")
+ .with_stderr_does_not_contain("-C strip")
.run();
}
diff -Nru cargo-0.58.0/tests/testsuite/publish.rs cargo-0.60.0ubuntu1/tests/testsuite/publish.rs
--- cargo-0.58.0/tests/testsuite/publish.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/publish.rs 2022-02-10 02:58:21.000000000 +0000
@@ -2,7 +2,7 @@
use cargo_test_support::git::{self, repo};
use cargo_test_support::paths;
-use cargo_test_support::registry::{self, registry_path, registry_url, Package};
+use cargo_test_support::registry::{self, registry_url, Package};
use cargo_test_support::{basic_manifest, no_such_file_err_msg, project, publish};
use std::fs;
@@ -185,57 +185,8 @@
validate_upload_foo();
}
-// TODO: Deprecated
-// remove once it has been decided --host can be removed
#[cargo_test]
-fn simple_with_host() {
- registry::init();
-
- let p = project()
- .file(
- "Cargo.toml",
- r#"
- [project]
- name = "foo"
- version = "0.0.1"
- authors = []
- license = "MIT"
- description = "foo"
- "#,
- )
- .file("src/main.rs", "fn main() {}")
- .build();
-
- p.cargo("publish --no-verify --token sekrit --host")
- .arg(registry_url().to_string())
- .with_stderr(&format!(
- "\
-[WARNING] The flag '--host' is no longer valid.
-
-Previous versions of Cargo accepted this flag, but it is being
-deprecated. The flag is being renamed to 'index', as the flag
-wants the location of the index. Please use '--index' instead.
-
-This will soon become a hard error, so it's either recommended
-to update to a fixed version or contact the upstream maintainer
-about this warning.
-[UPDATING] `{reg}` index
-[WARNING] manifest has no documentation, [..]
-See [..]
-[PACKAGING] foo v0.0.1 ([CWD])
-[UPLOADING] foo v0.0.1 ([CWD])
-",
- reg = registry_path().to_str().unwrap()
- ))
- .run();
-
- validate_upload_foo();
-}
-
-// TODO: Deprecated
-// remove once it has been decided --host can be removed
-#[cargo_test]
-fn simple_with_index_and_host() {
+fn simple_with_index() {
registry::init();
let p = project()
@@ -255,27 +206,6 @@
p.cargo("publish --no-verify --token sekrit --index")
.arg(registry_url().to_string())
- .arg("--host")
- .arg(registry_url().to_string())
- .with_stderr(&format!(
- "\
-[WARNING] The flag '--host' is no longer valid.
-
-Previous versions of Cargo accepted this flag, but it is being
-deprecated. The flag is being renamed to 'index', as the flag
-wants the location of the index. Please use '--index' instead.
-
-This will soon become a hard error, so it's either recommended
-to update to a fixed version or contact the upstream maintainer
-about this warning.
-[UPDATING] `{reg}` index
-[WARNING] manifest has no documentation, [..]
-See [..]
-[PACKAGING] foo v0.0.1 ([CWD])
-[UPLOADING] foo v0.0.1 ([CWD])
-",
- reg = registry_path().to_str().unwrap()
- ))
.run();
validate_upload_foo();
diff -Nru cargo-0.58.0/tests/testsuite/read_manifest.rs cargo-0.60.0ubuntu1/tests/testsuite/read_manifest.rs
--- cargo-0.58.0/tests/testsuite/read_manifest.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/read_manifest.rs 2022-02-10 02:58:21.000000000 +0000
@@ -16,6 +16,7 @@
"homepage": null,
"documentation": null,
"repository": null,
+ "rust_version": null,
"version":"0.5.0",
"id":"foo[..]0.5.0[..](path+file://[..]/foo)",
"keywords": [],
diff -Nru cargo-0.58.0/tests/testsuite/run.rs cargo-0.60.0ubuntu1/tests/testsuite/run.rs
--- cargo-0.58.0/tests/testsuite/run.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/run.rs 2022-02-10 02:58:21.000000000 +0000
@@ -22,18 +22,21 @@
}
#[cargo_test]
-fn simple_quiet() {
+fn quiet_arg() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
- p.cargo("run -q").with_stdout("hello").run();
+ p.cargo("run -q").with_stderr("").with_stdout("hello").run();
- p.cargo("run --quiet").with_stdout("hello").run();
+ p.cargo("run --quiet")
+ .with_stderr("")
+ .with_stdout("hello")
+ .run();
}
#[cargo_test]
-fn simple_quiet_and_verbose() {
+fn quiet_arg_and_verbose_arg() {
let p = project()
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
@@ -45,7 +48,7 @@
}
#[cargo_test]
-fn quiet_and_verbose_config() {
+fn quiet_arg_and_verbose_config() {
let p = project()
.file(
".cargo/config",
@@ -57,7 +60,52 @@
.file("src/main.rs", r#"fn main() { println!("hello"); }"#)
.build();
- p.cargo("run -q").run();
+ p.cargo("run -q").with_stderr("").with_stdout("hello").run();
+}
+
+#[cargo_test]
+fn verbose_arg_and_quiet_config() {
+ let p = project()
+ .file(
+ ".cargo/config",
+ r#"
+ [term]
+ quiet = true
+ "#,
+ )
+ .file("src/main.rs", r#"fn main() { println!("hello"); }"#)
+ .build();
+
+ p.cargo("run -v")
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+[RUNNING] `target/debug/foo[EXE]`",
+ )
+ .with_stdout("hello")
+ .run();
+}
+
+#[cargo_test]
+fn quiet_config_and_verbose_config() {
+ let p = project()
+ .file(
+ ".cargo/config",
+ r#"
+ [term]
+ verbose = true
+ quiet = true
+ "#,
+ )
+ .file("src/main.rs", r#"fn main() { println!("hello"); }"#)
+ .build();
+
+ p.cargo("run")
+ .with_status(101)
+ .with_stderr("[ERROR] cannot set both `term.verbose` and `term.quiet`")
+ .run();
}
#[cargo_test]
@@ -928,6 +976,29 @@
.with_stderr(
"\
[COMPILING] foo v0.0.1 ([CWD])
+[FINISHED] release [optimized] target(s) in [..]
+[RUNNING] `target/release/foo[EXE]`
+",
+ )
+ .run();
+ assert!(p.release_bin("foo").is_file());
+}
+
+#[cargo_test]
+fn release_short_works() {
+ let p = project()
+ .file(
+ "src/main.rs",
+ r#"
+ fn main() { if cfg!(debug_assertions) { panic!() } }
+ "#,
+ )
+ .build();
+
+ p.cargo("run -r")
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
[FINISHED] release [optimized] target(s) in [..]
[RUNNING] `target/release/foo[EXE]`
",
diff -Nru cargo-0.58.0/tests/testsuite/rustc.rs cargo-0.60.0ubuntu1/tests/testsuite/rustc.rs
--- cargo-0.58.0/tests/testsuite/rustc.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/rustc.rs 2022-02-10 02:58:21.000000000 +0000
@@ -135,6 +135,228 @@
}
#[cargo_test]
+fn fails_with_crate_type_and_without_unstable_options() {
+ let p = project().file("src/lib.rs", r#" "#).build();
+
+ p.cargo("rustc --crate-type lib")
+ .masquerade_as_nightly_cargo()
+ .with_status(101)
+ .with_stderr(
+ "[ERROR] the `crate-type` flag is unstable, pass `-Z unstable-options` to enable it
+See https://github.com/rust-lang/cargo/issues/10083 for more information about the `crate-type` flag.",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn fails_with_crate_type_to_multi_binaries() {
+ let p = project()
+ .file("src/bin/foo.rs", "fn main() {}")
+ .file("src/bin/bar.rs", "fn main() {}")
+ .file("src/bin/baz.rs", "fn main() {}")
+ .file("src/lib.rs", r#" "#)
+ .build();
+
+ p.cargo("rustc --crate-type lib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_status(101)
+ .with_stderr(
+ "[ERROR] crate types to rustc can only be passed to one target, consider filtering
+the package by passing, e.g., `--lib` or `--example` to specify a single target",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn fails_with_crate_type_to_multi_examples() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+
+ [[example]]
+ name = "ex1"
+ crate-type = ["rlib"]
+ [[example]]
+ name = "ex2"
+ crate-type = ["rlib"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("examples/ex1.rs", "")
+ .file("examples/ex2.rs", "")
+ .build();
+
+ p.cargo("rustc -v --example ex1 --example ex2 --crate-type lib,cdylib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_status(101)
+ .with_stderr(
+ "[ERROR] crate types to rustc can only be passed to one target, consider filtering
+the package by passing, e.g., `--lib` or `--example` to specify a single target",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn fails_with_crate_type_to_binary() {
+ let p = project().file("src/bin/foo.rs", "fn main() {}").build();
+
+ p.cargo("rustc --crate-type lib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_status(101)
+ .with_stderr(
+ "[ERROR] crate types can only be specified for libraries and example libraries.
+Binaries, tests, and benchmarks are always the `bin` crate type",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn build_with_crate_type_for_foo() {
+ let p = project()
+ .file("src/main.rs", "fn main() {}")
+ .file("src/lib.rs", r#" "#)
+ .build();
+
+ p.cargo("rustc -v --lib --crate-type lib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn build_with_crate_types_for_foo() {
+ let p = project()
+ .file("src/main.rs", "fn main() {}")
+ .file("src/lib.rs", r#" "#)
+ .build();
+
+ p.cargo("rustc -v --lib --crate-type lib,cdylib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib,cdylib [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn build_with_crate_type_to_example() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+
+ [[example]]
+ name = "ex"
+ crate-type = ["rlib"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("examples/ex.rs", "")
+ .build();
+
+ p.cargo("rustc -v --example ex --crate-type cdylib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib [..]
+[RUNNING] `rustc --crate-name ex examples/ex.rs [..]--crate-type cdylib [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn build_with_crate_types_to_example() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+
+ [[example]]
+ name = "ex"
+ crate-type = ["rlib"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("examples/ex.rs", "")
+ .build();
+
+ p.cargo("rustc -v --example ex --crate-type lib,cdylib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib [..]
+[RUNNING] `rustc --crate-name ex examples/ex.rs [..]--crate-type lib,cdylib [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn build_with_crate_types_to_one_of_multi_examples() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.0.1"
+ authors = []
+
+ [[example]]
+ name = "ex1"
+ crate-type = ["rlib"]
+ [[example]]
+ name = "ex2"
+ crate-type = ["rlib"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file("examples/ex1.rs", "")
+ .file("examples/ex2.rs", "")
+ .build();
+
+ p.cargo("rustc -v --example ex1 --crate-type lib,cdylib -Zunstable-options")
+ .masquerade_as_nightly_cargo()
+ .with_stderr(
+ "\
+[COMPILING] foo v0.0.1 ([CWD])
+[RUNNING] `rustc --crate-name foo src/lib.rs [..]--crate-type lib [..]
+[RUNNING] `rustc --crate-name ex1 examples/ex1.rs [..]--crate-type lib,cdylib [..]
+[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
+",
+ )
+ .run();
+}
+
+#[cargo_test]
fn build_with_args_to_one_of_multiple_tests() {
let p = project()
.file("tests/foo.rs", r#" "#)
diff -Nru cargo-0.58.0/tests/testsuite/rustdoc.rs cargo-0.60.0ubuntu1/tests/testsuite/rustdoc.rs
--- cargo-0.58.0/tests/testsuite/rustdoc.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/rustdoc.rs 2022-02-10 02:58:21.000000000 +0000
@@ -32,6 +32,7 @@
-o [CWD]/target/doc \
[..] \
--cfg=foo \
+ -C metadata=[..] \
-L dependency=[CWD]/target/debug/deps [..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
@@ -83,6 +84,7 @@
-o [CWD]/target/doc \
[..] \
--cfg=foo \
+ -C metadata=[..] \
-L dependency=[CWD]/target/debug/deps \
--extern [..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
@@ -122,6 +124,7 @@
-o [CWD]/target/doc \
[..] \
--cfg=foo \
+ -C metadata=[..] \
-L dependency=[CWD]/target/debug/deps [..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
@@ -144,6 +147,7 @@
-o [CWD]/target/doc \
[..] \
--cfg=foo \
+ -C metadata=[..] \
-L dependency=[CWD]/target/debug/deps [..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
diff -Nru cargo-0.58.0/tests/testsuite/search.rs cargo-0.60.0ubuntu1/tests/testsuite/search.rs
--- cargo-0.58.0/tests/testsuite/search.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/search.rs 2022-02-10 02:58:21.000000000 +0000
@@ -181,60 +181,6 @@
.run();
}
-// TODO: Deprecated
-// remove once it has been decided '--host' can be safely removed
-#[cargo_test]
-fn simple_with_host() {
- setup();
-
- cargo_process("search postgres --host")
- .arg(registry_url().to_string())
- .with_stderr(
- "\
-[WARNING] The flag '--host' is no longer valid.
-
-Previous versions of Cargo accepted this flag, but it is being
-deprecated. The flag is being renamed to 'index', as the flag
-wants the location of the index. Please use '--index' instead.
-
-This will soon become a hard error, so it's either recommended
-to update to a fixed version or contact the upstream maintainer
-about this warning.
-[UPDATING] `[CWD]/registry` index
-",
- )
- .with_stdout_contains(SEARCH_RESULTS)
- .run();
-}
-
-// TODO: Deprecated
-// remove once it has been decided '--host' can be safely removed
-#[cargo_test]
-fn simple_with_index_and_host() {
- setup();
-
- cargo_process("search postgres --index")
- .arg(registry_url().to_string())
- .arg("--host")
- .arg(registry_url().to_string())
- .with_stderr(
- "\
-[WARNING] The flag '--host' is no longer valid.
-
-Previous versions of Cargo accepted this flag, but it is being
-deprecated. The flag is being renamed to 'index', as the flag
-wants the location of the index. Please use '--index' instead.
-
-This will soon become a hard error, so it's either recommended
-to update to a fixed version or contact the upstream maintainer
-about this warning.
-[UPDATING] `[CWD]/registry` index
-",
- )
- .with_stdout_contains(SEARCH_RESULTS)
- .run();
-}
-
#[cargo_test]
fn multiple_query_params() {
setup();
diff -Nru cargo-0.58.0/tests/testsuite/tool_paths.rs cargo-0.60.0ubuntu1/tests/testsuite/tool_paths.rs
--- cargo-0.58.0/tests/testsuite/tool_paths.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/tool_paths.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1,8 +1,6 @@
//! Tests for configuration values that point to programs.
-use cargo_test_support::{
- basic_lib_manifest, no_such_file_err_msg, project, rustc_host, rustc_host_env,
-};
+use cargo_test_support::{basic_lib_manifest, project, rustc_host, rustc_host_env};
#[cargo_test]
fn pathless_tools() {
@@ -271,6 +269,9 @@
p.cargo("run")
.env(&key, "nonexistent-runner --foo")
.with_status(101)
+ // FIXME: Update "Caused by" error message once rust/pull/87704 is merged.
+ // On Windows, changing to a custom executable resolver has changed the
+ // error messages.
.with_stderr(&format!(
"\
[COMPILING] foo [..]
@@ -279,9 +280,8 @@
[ERROR] could not execute process `nonexistent-runner --foo target/debug/foo[EXE]` (never executed)
Caused by:
- {}
-",
- no_such_file_err_msg()
+ [..]
+"
))
.run();
}
diff -Nru cargo-0.58.0/tests/testsuite/tree.rs cargo-0.60.0ubuntu1/tests/testsuite/tree.rs
--- cargo-0.58.0/tests/testsuite/tree.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/tree.rs 2022-02-10 02:58:21.000000000 +0000
@@ -1831,3 +1831,219 @@
.with_status(101)
.run();
}
+
+#[cargo_test]
+fn cyclic_features() {
+ // Check for stack overflow with cyclic features (oops!).
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [features]
+ a = ["b"]
+ b = ["a"]
+ default = ["a"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .build();
+
+ p.cargo("tree -e features")
+ .with_stdout("foo v1.0.0 ([ROOT]/foo)")
+ .run();
+
+ p.cargo("tree -e features -i foo")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+├── foo feature \"a\"
+│ ├── foo feature \"b\"
+│ │ └── foo feature \"a\" (*)
+│ └── foo feature \"default\" (command-line)
+├── foo feature \"b\" (*)
+└── foo feature \"default\" (command-line)
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn dev_dep_cycle_with_feature() {
+ // Cycle with features and a dev-dependency.
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [dev-dependencies]
+ bar = { path = "bar" }
+
+ [features]
+ a = ["bar/feat1"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "1.0.0"
+
+ [dependencies]
+ foo = { path = ".." }
+
+ [features]
+ feat1 = ["foo/a"]
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .build();
+
+ p.cargo("tree -e features --features a")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+[dev-dependencies]
+└── bar feature \"default\"
+ └── bar v1.0.0 ([ROOT]/foo/bar)
+ └── foo feature \"default\" (command-line)
+ └── foo v1.0.0 ([ROOT]/foo) (*)
+",
+ )
+ .run();
+
+ p.cargo("tree -e features --features a -i foo")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+├── foo feature \"a\" (command-line)
+│ └── bar feature \"feat1\"
+│ └── foo feature \"a\" (command-line) (*)
+└── foo feature \"default\" (command-line)
+ └── bar v1.0.0 ([ROOT]/foo/bar)
+ ├── bar feature \"default\"
+ │ [dev-dependencies]
+ │ └── foo v1.0.0 ([ROOT]/foo) (*)
+ └── bar feature \"feat1\" (*)
+",
+ )
+ .run();
+}
+
+#[cargo_test]
+fn dev_dep_cycle_with_feature_nested() {
+ // Checks for an issue where a cyclic dev dependency tries to activate a
+ // feature on its parent that tries to activate the feature back on the
+ // dev-dependency.
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "1.0.0"
+
+ [dev-dependencies]
+ bar = { path = "bar" }
+
+ [features]
+ a = ["bar/feat1"]
+ b = ["a"]
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "1.0.0"
+
+ [dependencies]
+ foo = { path = ".." }
+
+ [features]
+ feat1 = ["foo/b"]
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .build();
+
+ p.cargo("tree -e features")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+[dev-dependencies]
+└── bar feature \"default\"
+ └── bar v1.0.0 ([ROOT]/foo/bar)
+ └── foo feature \"default\" (command-line)
+ └── foo v1.0.0 ([ROOT]/foo) (*)
+",
+ )
+ .run();
+
+ p.cargo("tree -e features --features a -i foo")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+├── foo feature \"a\" (command-line)
+│ └── foo feature \"b\"
+│ └── bar feature \"feat1\"
+│ └── foo feature \"a\" (command-line) (*)
+├── foo feature \"b\" (*)
+└── foo feature \"default\" (command-line)
+ └── bar v1.0.0 ([ROOT]/foo/bar)
+ ├── bar feature \"default\"
+ │ [dev-dependencies]
+ │ └── foo v1.0.0 ([ROOT]/foo) (*)
+ └── bar feature \"feat1\" (*)
+",
+ )
+ .run();
+
+ p.cargo("tree -e features --features b -i foo")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+├── foo feature \"a\"
+│ └── foo feature \"b\" (command-line)
+│ └── bar feature \"feat1\"
+│ └── foo feature \"a\" (*)
+├── foo feature \"b\" (command-line) (*)
+└── foo feature \"default\" (command-line)
+ └── bar v1.0.0 ([ROOT]/foo/bar)
+ ├── bar feature \"default\"
+ │ [dev-dependencies]
+ │ └── foo v1.0.0 ([ROOT]/foo) (*)
+ └── bar feature \"feat1\" (*)
+",
+ )
+ .run();
+
+ p.cargo("tree -e features --features bar/feat1 -i foo")
+ .with_stdout(
+ "\
+foo v1.0.0 ([ROOT]/foo)
+├── foo feature \"a\"
+│ └── foo feature \"b\"
+│ └── bar feature \"feat1\" (command-line)
+│ └── foo feature \"a\" (*)
+├── foo feature \"b\" (*)
+└── foo feature \"default\" (command-line)
+ └── bar v1.0.0 ([ROOT]/foo/bar)
+ ├── bar feature \"default\"
+ │ [dev-dependencies]
+ │ └── foo v1.0.0 ([ROOT]/foo) (*)
+ └── bar feature \"feat1\" (command-line) (*)
+",
+ )
+ .run();
+}
diff -Nru cargo-0.58.0/tests/testsuite/update.rs cargo-0.60.0ubuntu1/tests/testsuite/update.rs
--- cargo-0.58.0/tests/testsuite/update.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/update.rs 2022-02-10 02:58:21.000000000 +0000
@@ -464,6 +464,7 @@
"name": "bar",
"readme": null,
"repository": null,
+ "rust_version": null,
"source": null,
"targets": [
{
@@ -504,6 +505,7 @@
"name": "serde",
"readme": null,
"repository": null,
+ "rust_version": null,
"source": "registry+https://github.com/rust-lang/crates.io-index",
"targets": [
{
diff -Nru cargo-0.58.0/tests/testsuite/vendor.rs cargo-0.60.0ubuntu1/tests/testsuite/vendor.rs
--- cargo-0.58.0/tests/testsuite/vendor.rs 2021-10-21 14:30:11.000000000 +0000
+++ cargo-0.60.0ubuntu1/tests/testsuite/vendor.rs 2022-02-10 02:58:21.000000000 +0000
@@ -753,3 +753,34 @@
let metadata = fs::metadata(p.root().join("vendor/bar/example.sh")).unwrap();
assert_eq!(metadata.mode() & 0o777, 0o755);
}
+
+#[cargo_test]
+fn no_remote_dependency_no_vendor() {
+ let p = project()
+ .file(
+ "Cargo.toml",
+ r#"
+ [package]
+ name = "foo"
+ version = "0.1.0"
+ [dependencies]
+ bar = { path = "bar" }
+ "#,
+ )
+ .file("src/lib.rs", "")
+ .file(
+ "bar/Cargo.toml",
+ r#"
+ [package]
+ name = "bar"
+ version = "0.1.0"
+ "#,
+ )
+ .file("bar/src/lib.rs", "")
+ .build();
+
+ p.cargo("vendor")
+ .with_stderr("There is no dependency to vendor in this project.")
+ .run();
+ assert!(!p.root().join("vendor").exists());
+}
diff -Nru cargo-0.58.0/vendor/anyhow/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/anyhow/.cargo-checksum.json
--- cargo-0.58.0/vendor/anyhow/.cargo-checksum.json 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3"}
\ No newline at end of file
+{"files":{},"package":"4361135be9122e0870de935d7c439aef945b9f9ddd4199a553b5270b49c82a27"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/anyhow/Cargo.toml cargo-0.60.0ubuntu1/vendor/anyhow/Cargo.toml
--- cargo-0.58.0/vendor/anyhow/Cargo.toml 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -13,7 +13,7 @@
edition = "2018"
rust-version = "1.38"
name = "anyhow"
-version = "1.0.52"
+version = "1.0.56"
authors = ["David Tolnay "]
description = "Flexible concrete Error type built on std::error::Error"
documentation = "https://docs.rs/anyhow"
@@ -21,12 +21,15 @@
categories = ["rust-patterns"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/anyhow"
+
[package.metadata.docs.rs]
-rustdoc-args = ["--cfg", "doc_cfg"]
targets = ["x86_64-unknown-linux-gnu"]
-[dependencies.backtrace]
-version = "0.3.51"
-optional = true
+rustdoc-args = [
+ "--cfg",
+ "doc_cfg",
+]
+
+
[dev-dependencies.futures]
version = "0.3"
default-features = false
diff -Nru cargo-0.58.0/vendor/anyhow/debian/patches/drop-backtrace.patch cargo-0.60.0ubuntu1/vendor/anyhow/debian/patches/drop-backtrace.patch
--- cargo-0.58.0/vendor/anyhow/debian/patches/drop-backtrace.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/debian/patches/drop-backtrace.patch 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,14 @@
+Index: anyhow/Cargo.toml
+===================================================================
+--- anyhow.orig/Cargo.toml
++++ anyhow/Cargo.toml
+@@ -23,9 +23,6 @@ repository = "https://github.com/dtolnay
+ rustdoc-args = ["--cfg", "doc_cfg"]
+ targets = ["x86_64-unknown-linux-gnu"]
+
+-[dependencies.backtrace]
+-version = "0.3.51"
+-optional = true
+
+ [dev-dependencies.futures]
+ version = "0.3"
diff -Nru cargo-0.58.0/vendor/anyhow/debian/patches/series cargo-0.60.0ubuntu1/vendor/anyhow/debian/patches/series
--- cargo-0.58.0/vendor/anyhow/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1 @@
+drop-backtrace.patch
diff -Nru cargo-0.58.0/vendor/anyhow/src/ensure.rs cargo-0.60.0ubuntu1/vendor/anyhow/src/ensure.rs
--- cargo-0.58.0/vendor/anyhow/src/ensure.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/src/ensure.rs 2022-04-20 13:48:09.000000000 +0000
@@ -257,6 +257,10 @@
$crate::__parse_ensure!(generic (epath $stack) $bail ($($fuel)*) {($($buf)* $colons <) $($parse)*} (< $($rest)*) < $($rest)*)
};
+ (epath $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: <- $($rest:tt)*) => {
+ $crate::__parse_ensure!(generic (epath $stack) $bail ($($fuel)*) {($($buf)* $colons <) $($parse)*} (- $($rest)*) - $($rest)*)
+ };
+
(epath $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: $ident:ident $($rest:tt)*) => {
$crate::__parse_ensure!(epath $stack $bail ($($fuel)*) {($($buf)* $colons $ident) $($parse)*} ($($rest)*) $($rest)*)
};
@@ -303,6 +307,10 @@
$crate::__parse_ensure!(generic (atom $stack) $bail ($($fuel)*) {($($buf)* $dot $ident $colons <) $($parse)*} (< $($rest)*) < $($rest)*)
};
+ (atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($dot:tt $ident:tt $colons:tt $($dup:tt)*) . $i:ident :: <- $($rest:tt)*) => {
+ $crate::__parse_ensure!(generic (atom $stack) $bail ($($fuel)*) {($($buf)* $dot $ident $colons <) $($parse)*} (- $($rest)*) - $($rest)*)
+ };
+
(atom $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($dot:tt $($dup:tt)*) . $field:ident $($rest:tt)*) => {
$crate::__parse_ensure!(atom $stack $bail ($($fuel)*) {($($buf)* $dot $field) $($parse)*} ($($rest)*) $($rest)*)
};
@@ -427,6 +435,10 @@
$crate::__parse_ensure!(generic (tpath $stack) $bail ($($fuel)*) {($($buf)* <) $($parse)*} (< $($rest)*) < $($rest)*)
};
+ (tpath $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} $dup:tt <- $($rest:tt)*) => {
+ $crate::__parse_ensure!(generic (tpath $stack) $bail ($($fuel)*) {($($buf)* <) $($parse)*} (- $($rest)*) - $($rest)*)
+ };
+
(tpath $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $langle:tt $($dup:tt)*) :: < $($rest:tt)*) => {
$crate::__parse_ensure!(generic (tpath $stack) $bail ($($fuel)*) {($($buf)* $colons $langle) $($parse)*} ($($rest)*) $($rest)*)
};
@@ -435,6 +447,10 @@
$crate::__parse_ensure!(generic (tpath $stack) $bail ($($fuel)*) {($($buf)* $colons <) $($parse)*} (< $($rest)*) < $($rest)*)
};
+ (tpath $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: <- $($rest:tt)*) => {
+ $crate::__parse_ensure!(generic (tpath $stack) $bail ($($fuel)*) {($($buf)* $colons <) $($parse)*} (- $($rest)*) - $($rest)*)
+ };
+
(tpath $stack:tt $bail:tt (~$($fuel:tt)*) {($($buf:tt)*) $($parse:tt)*} ($colons:tt $($dup:tt)*) :: $ident:ident $($rest:tt)*) => {
$crate::__parse_ensure!(tpath $stack $bail ($($fuel)*) {($($buf)* $colons $ident) $($parse)*} ($($rest)*) $($rest)*)
};
@@ -802,17 +818,17 @@
};
($cond:expr, $msg:literal $(,)?) => {
if !$cond {
- return $crate::private::Err($crate::anyhow!($msg));
+ return $crate::private::Err($crate::__anyhow!($msg));
}
};
($cond:expr, $err:expr $(,)?) => {
if !$cond {
- return $crate::private::Err($crate::anyhow!($err));
+ return $crate::private::Err($crate::__anyhow!($err));
}
};
($cond:expr, $fmt:expr, $($arg:tt)*) => {
if !$cond {
- return $crate::private::Err($crate::anyhow!($fmt, $($arg)*));
+ return $crate::private::Err($crate::__anyhow!($fmt, $($arg)*));
}
};
}
diff -Nru cargo-0.58.0/vendor/anyhow/src/error.rs cargo-0.60.0ubuntu1/vendor/anyhow/src/error.rs
--- cargo-0.58.0/vendor/anyhow/src/error.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/src/error.rs 2022-04-20 13:48:09.000000000 +0000
@@ -26,6 +26,7 @@
#[cfg(feature = "std")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "std")))]
#[cold]
+ #[must_use]
pub fn new(error: E) -> Self
where
E: StdError + Send + Sync + 'static,
@@ -72,6 +73,7 @@
/// }
/// ```
#[cold]
+ #[must_use]
pub fn msg(message: M) -> Self
where
M: Display + Debug + Send + Sync + 'static,
@@ -293,6 +295,7 @@
/// }
/// ```
#[cold]
+ #[must_use]
pub fn context(self, context: C) -> Self
where
C: Display + Send + Sync + 'static,
diff -Nru cargo-0.58.0/vendor/anyhow/src/lib.rs cargo-0.60.0ubuntu1/vendor/anyhow/src/lib.rs
--- cargo-0.58.0/vendor/anyhow/src/lib.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/src/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -210,7 +210,7 @@
//! will require an explicit `.map_err(Error::msg)` when working with a
//! non-Anyhow error type inside a function that returns Anyhow's error type.
-#![doc(html_root_url = "https://docs.rs/anyhow/1.0.52")]
+#![doc(html_root_url = "https://docs.rs/anyhow/1.0.56")]
#![cfg_attr(backtrace, feature(backtrace))]
#![cfg_attr(doc_cfg, feature(doc_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]
@@ -496,6 +496,11 @@
/// No such file or directory (os error 2)
/// ```
///
+/// Refer to the [Display representations] documentation for other forms in
+/// which this context chain can be rendered.
+///
+/// [Display representations]: Error#display-representations
+///
///
///
/// # Effect on downcasting
@@ -663,4 +668,12 @@
Error::msg(fmt::format(args))
}
}
+
+ #[doc(hidden)]
+ #[inline]
+ #[cold]
+ #[must_use]
+ pub fn must_use(error: Error) -> Error {
+ error
+ }
}
diff -Nru cargo-0.58.0/vendor/anyhow/src/macros.rs cargo-0.60.0ubuntu1/vendor/anyhow/src/macros.rs
--- cargo-0.58.0/vendor/anyhow/src/macros.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/src/macros.rs 2022-04-20 13:48:09.000000000 +0000
@@ -54,13 +54,13 @@
#[macro_export]
macro_rules! bail {
($msg:literal $(,)?) => {
- return $crate::private::Err($crate::anyhow!($msg))
+ return $crate::private::Err($crate::__anyhow!($msg))
};
($err:expr $(,)?) => {
- return $crate::private::Err($crate::anyhow!($err))
+ return $crate::private::Err($crate::__anyhow!($err))
};
($fmt:expr, $($arg:tt)*) => {
- return $crate::private::Err($crate::anyhow!($fmt, $($arg)*))
+ return $crate::private::Err($crate::__anyhow!($fmt, $($arg)*))
};
}
@@ -75,13 +75,13 @@
return $crate::private::Err($crate::Error::msg("pattern does not contain `{}`"))
};
($msg:literal $(,)?) => {
- return $crate::private::Err($crate::anyhow!($msg))
+ return $crate::private::Err($crate::__anyhow!($msg))
};
($err:expr $(,)?) => {
- return $crate::private::Err($crate::anyhow!($err))
+ return $crate::private::Err($crate::__anyhow!($err))
};
($fmt:expr, $($arg:tt)*) => {
- return $crate::private::Err($crate::anyhow!($fmt, $($arg)*))
+ return $crate::private::Err($crate::__anyhow!($fmt, $($arg)*))
};
}
@@ -145,17 +145,17 @@
};
($cond:expr, $msg:literal $(,)?) => {
if !$cond {
- return $crate::private::Err($crate::anyhow!($msg));
+ return $crate::private::Err($crate::__anyhow!($msg));
}
};
($cond:expr, $err:expr $(,)?) => {
if !$cond {
- return $crate::private::Err($crate::anyhow!($err));
+ return $crate::private::Err($crate::__anyhow!($err));
}
};
($cond:expr, $fmt:expr, $($arg:tt)*) => {
if !$cond {
- return $crate::private::Err($crate::anyhow!($fmt, $($arg)*));
+ return $crate::private::Err($crate::__anyhow!($fmt, $($arg)*));
}
};
}
@@ -206,6 +206,32 @@
/// ```
#[macro_export]
macro_rules! anyhow {
+ ($msg:literal $(,)?) => {
+ $crate::private::must_use({
+ let error = $crate::private::format_err($crate::private::format_args!($msg));
+ error
+ })
+ };
+ ($err:expr $(,)?) => {
+ $crate::private::must_use({
+ use $crate::private::kind::*;
+ let error = match $err {
+ error => (&error).anyhow_kind().new(error),
+ };
+ error
+ })
+ };
+ ($fmt:expr, $($arg:tt)*) => {
+ $crate::Error::msg($crate::private::format!($fmt, $($arg)*))
+ };
+}
+
+// Not public API. This is used in the implementation of some of the other
+// macros, in which the must_use call is not needed because the value is known
+// to be used.
+#[doc(hidden)]
+#[macro_export]
+macro_rules! __anyhow {
($msg:literal $(,)?) => ({
let error = $crate::private::format_err($crate::private::format_args!($msg));
error
diff -Nru cargo-0.58.0/vendor/anyhow/tests/test_ensure.rs cargo-0.60.0ubuntu1/vendor/anyhow/tests/test_ensure.rs
--- cargo-0.58.0/vendor/anyhow/tests/test_ensure.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/tests/test_ensure.rs 2022-04-20 13:48:09.000000000 +0000
@@ -13,7 +13,8 @@
clippy::too_many_lines,
clippy::unit_arg,
clippy::while_immutable_condition,
- clippy::zero_ptr
+ clippy::zero_ptr,
+ irrefutable_let_patterns
)]
use anyhow::{anyhow, ensure, Chain, Error, Result};
@@ -323,6 +324,18 @@
"Condition failed: `Chain::<'static>::new.t(1) == 2` (1 vs 2)",
);
+ fn f() {}
+ let test = || Ok(ensure!(f::<1>() != ()));
+ assert_err(test, "Condition failed: `f::<1>() != ()` (() vs ())");
+ let test = || Ok(ensure!(f::<-1>() != ()));
+ assert_err(test, "Condition failed: `f::<-1>() != ()` (() vs ())");
+
+ fn g() {}
+ let test = || Ok(ensure!(g::() != ()));
+ assert_err(test, "Condition failed: `g::() != ()` (() vs ())");
+ let test = || Ok(ensure!(g::() != ()));
+ assert_err(test, "Condition failed: `g::() != ()` (() vs ())");
+
#[derive(PartialOrd, PartialEq, Debug)]
enum E<'a, T> {
#[allow(dead_code)]
@@ -395,7 +408,7 @@
let test = || Ok(ensure!(PhantomData:: {} != PhantomData));
assert_err(
test,
- "Condition failed: `PhantomData::{} != PhantomData` (PhantomData vs PhantomData)",
+ "Condition failed: `PhantomData:: {} != PhantomData` (PhantomData vs PhantomData)",
);
let result = Ok::<_, Error>(1);
@@ -528,7 +541,7 @@
let test = || Ok(ensure!(f as for<'a> fn() as usize * 0 != 0));
assert_err(
test,
- "Condition failed: `f as for<'a>fn() as usize * 0 != 0` (0 vs 0)", // FIXME
+ "Condition failed: `f as for<'a> fn() as usize * 0 != 0` (0 vs 0)",
);
let test = || Ok(ensure!(f as unsafe fn() as usize * 0 != 0));
@@ -613,7 +626,7 @@
let test = || Ok(ensure!(if let -1..=1 = 0 { 0 } else { 1 } == 1));
assert_err(
test,
- "Condition failed: `if let -1 ..=1 = 0 { 0 } else { 1 } == 1` (0 vs 1)", // FIXME
+ "Condition failed: `if let -1..=1 = 0 { 0 } else { 1 } == 1` (0 vs 1)",
);
let test = || Ok(ensure!(if let &0 = &0 { 0 } else { 1 } == 1));
@@ -656,7 +669,7 @@
let test = || Ok(ensure!(if let P:: {} = p { 0 } else { 1 } == 1));
assert_err(
test,
- "Condition failed: `if let P:: { } = p { 0 } else { 1 } == 1` (0 vs 1)", // FIXME
+ "Condition failed: `if let P:: {} = p { 0 } else { 1 } == 1` (0 vs 1)",
);
let test = || Ok(ensure!(if let ::std::marker::PhantomData = p {} != ()));
diff -Nru cargo-0.58.0/vendor/anyhow/tests/ui/must-use.rs cargo-0.60.0ubuntu1/vendor/anyhow/tests/ui/must-use.rs
--- cargo-0.58.0/vendor/anyhow/tests/ui/must-use.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/tests/ui/must-use.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,11 @@
+#![deny(unused_must_use)]
+
+use anyhow::anyhow;
+
+fn main() -> anyhow::Result<()> {
+ if true {
+ // meant to write bail!
+ anyhow!("it failed");
+ }
+ Ok(())
+}
diff -Nru cargo-0.58.0/vendor/anyhow/tests/ui/must-use.stderr cargo-0.60.0ubuntu1/vendor/anyhow/tests/ui/must-use.stderr
--- cargo-0.58.0/vendor/anyhow/tests/ui/must-use.stderr 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/anyhow/tests/ui/must-use.stderr 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,12 @@
+error: unused return value of `must_use` that must be used
+ --> tests/ui/must-use.rs:8:9
+ |
+8 | anyhow!("it failed");
+ | ^^^^^^^^^^^^^^^^^^^^
+ |
+note: the lint level is defined here
+ --> tests/ui/must-use.rs:1:9
+ |
+1 | #![deny(unused_must_use)]
+ | ^^^^^^^^^^^^^^^
+ = note: this error originates in the macro `anyhow` (in Nightly builds, run with -Z macro-backtrace for more info)
diff -Nru cargo-0.58.0/vendor/autocfg/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/autocfg/.cargo-checksum.json
--- cargo-0.58.0/vendor/autocfg/.cargo-checksum.json 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"}
\ No newline at end of file
+{"files":{},"package":"d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/autocfg/Cargo.lock cargo-0.60.0ubuntu1/vendor/autocfg/Cargo.lock
--- cargo-0.58.0/vendor/autocfg/Cargo.lock 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/Cargo.lock 2022-04-20 13:48:09.000000000 +0000
@@ -1,6 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
+version = 3
+
[[package]]
name = "autocfg"
-version = "1.0.1"
-
+version = "1.1.0"
diff -Nru cargo-0.58.0/vendor/autocfg/Cargo.toml cargo-0.60.0ubuntu1/vendor/autocfg/Cargo.toml
--- cargo-0.58.0/vendor/autocfg/Cargo.toml 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -3,16 +3,15 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
name = "autocfg"
-version = "1.0.1"
+version = "1.1.0"
authors = ["Josh Stone "]
exclude = ["/.github/**", "/bors.toml"]
description = "Automatic cfg for Rust compiler features"
diff -Nru cargo-0.58.0/vendor/autocfg/README.md cargo-0.60.0ubuntu1/vendor/autocfg/README.md
--- cargo-0.58.0/vendor/autocfg/README.md 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/README.md 2022-04-20 13:48:09.000000000 +0000
@@ -43,6 +43,9 @@
## Release Notes
+- 1.1.0 (2022-02-07)
+ - Use `CARGO_ENCODED_RUSTFLAGS` when it is set.
+
- 1.0.1 (2020-08-20)
- Apply `RUSTFLAGS` for more `--target` scenarios, by @adamreichold.
diff -Nru cargo-0.58.0/vendor/autocfg/src/lib.rs cargo-0.60.0ubuntu1/vendor/autocfg/src/lib.rs
--- cargo-0.58.0/vendor/autocfg/src/lib.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/src/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -63,7 +63,7 @@
use std::ffi::OsString;
use std::fs;
use std::io::{stderr, Write};
-use std::path::PathBuf;
+use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
#[allow(deprecated)]
use std::sync::atomic::ATOMIC_USIZE_INIT;
@@ -86,7 +86,7 @@
rustc_version: Version,
target: Option,
no_std: bool,
- rustflags: Option>,
+ rustflags: Vec,
}
/// Writes a config flag for rustc on standard out.
@@ -166,37 +166,13 @@
return Err(error::from_str("output path is not a writable directory"));
}
- // Cargo only applies RUSTFLAGS for building TARGET artifact in
- // cross-compilation environment. Sadly, we don't have a way to detect
- // when we're building HOST artifact in a cross-compilation environment,
- // so for now we only apply RUSTFLAGS when cross-compiling an artifact.
- //
- // See https://github.com/cuviper/autocfg/pull/10#issuecomment-527575030.
- let rustflags = if target != env::var_os("HOST")
- || dir_contains_target(&target, &dir, env::var_os("CARGO_TARGET_DIR"))
- {
- env::var("RUSTFLAGS").ok().map(|rustflags| {
- // This is meant to match how cargo handles the RUSTFLAG environment
- // variable.
- // See https://github.com/rust-lang/cargo/blob/69aea5b6f69add7c51cca939a79644080c0b0ba0/src/cargo/core/compiler/build_context/target_info.rs#L434-L441
- rustflags
- .split(' ')
- .map(str::trim)
- .filter(|s| !s.is_empty())
- .map(str::to_string)
- .collect::>()
- })
- } else {
- None
- };
-
let mut ac = AutoCfg {
+ rustflags: rustflags(&target, &dir),
out_dir: dir,
rustc: rustc,
rustc_version: rustc_version,
target: target,
no_std: false,
- rustflags: rustflags,
};
// Sanity check with and without `std`.
@@ -240,14 +216,12 @@
.arg(&self.out_dir)
.arg("--emit=llvm-ir");
- if let &Some(ref rustflags) = &self.rustflags {
- command.args(rustflags);
- }
-
if let Some(target) = self.target.as_ref() {
command.arg("--target").arg(target);
}
+ command.args(&self.rustflags);
+
command.arg("-").stdin(Stdio::piped());
let mut child = try!(command.spawn().map_err(error::from_io));
let mut stdin = child.stdin.take().expect("rustc stdin");
@@ -417,7 +391,7 @@
fn dir_contains_target(
target: &Option,
- dir: &PathBuf,
+ dir: &Path,
cargo_target_dir: Option,
) -> bool {
target
@@ -436,3 +410,44 @@
})
.unwrap_or(false)
}
+
+fn rustflags(target: &Option, dir: &Path) -> Vec {
+ // Starting with rust-lang/cargo#9601, shipped in Rust 1.55, Cargo always sets
+ // CARGO_ENCODED_RUSTFLAGS for any host/target build script invocation. This
+ // includes any source of flags, whether from the environment, toml config, or
+ // whatever may come in the future. The value is either an empty string, or a
+ // list of arguments separated by the ASCII unit separator (US), 0x1f.
+ if let Ok(a) = env::var("CARGO_ENCODED_RUSTFLAGS") {
+ return if a.is_empty() {
+ Vec::new()
+ } else {
+ a.split('\x1f').map(str::to_string).collect()
+ };
+ }
+
+ // Otherwise, we have to take a more heuristic approach, and we don't
+ // support values from toml config at all.
+ //
+ // Cargo only applies RUSTFLAGS for building TARGET artifact in
+ // cross-compilation environment. Sadly, we don't have a way to detect
+ // when we're building HOST artifact in a cross-compilation environment,
+ // so for now we only apply RUSTFLAGS when cross-compiling an artifact.
+ //
+ // See https://github.com/cuviper/autocfg/pull/10#issuecomment-527575030.
+ if *target != env::var_os("HOST")
+ || dir_contains_target(target, dir, env::var_os("CARGO_TARGET_DIR"))
+ {
+ if let Ok(rustflags) = env::var("RUSTFLAGS") {
+ // This is meant to match how cargo handles the RUSTFLAGS environment variable.
+ // See https://github.com/rust-lang/cargo/blob/69aea5b6f69add7c51cca939a79644080c0b0ba0/src/cargo/core/compiler/build_context/target_info.rs#L434-L441
+ return rustflags
+ .split(' ')
+ .map(str::trim)
+ .filter(|s| !s.is_empty())
+ .map(str::to_string)
+ .collect();
+ }
+ }
+
+ Vec::new()
+}
diff -Nru cargo-0.58.0/vendor/autocfg/src/tests.rs cargo-0.60.0ubuntu1/vendor/autocfg/src/tests.rs
--- cargo-0.58.0/vendor/autocfg/src/tests.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/src/tests.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,5 +1,6 @@
use super::AutoCfg;
use std::env;
+use std::path::Path;
impl AutoCfg {
fn core_std(&self, path: &str) -> String {
@@ -136,7 +137,7 @@
fn dir_does_not_contain_target() {
assert!(!super::dir_contains_target(
&Some("x86_64-unknown-linux-gnu".into()),
- &"/project/target/debug/build/project-ea75983148559682/out".into(),
+ Path::new("/project/target/debug/build/project-ea75983148559682/out"),
None,
));
}
@@ -145,7 +146,9 @@
fn dir_does_contain_target() {
assert!(super::dir_contains_target(
&Some("x86_64-unknown-linux-gnu".into()),
- &"/project/target/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out".into(),
+ Path::new(
+ "/project/target/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out"
+ ),
None,
));
}
@@ -154,7 +157,7 @@
fn dir_does_not_contain_target_with_custom_target_dir() {
assert!(!super::dir_contains_target(
&Some("x86_64-unknown-linux-gnu".into()),
- &"/project/custom/debug/build/project-ea75983148559682/out".into(),
+ Path::new("/project/custom/debug/build/project-ea75983148559682/out"),
Some("custom".into()),
));
}
@@ -163,7 +166,9 @@
fn dir_does_contain_target_with_custom_target_dir() {
assert!(super::dir_contains_target(
&Some("x86_64-unknown-linux-gnu".into()),
- &"/project/custom/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out".into(),
+ Path::new(
+ "/project/custom/x86_64-unknown-linux-gnu/debug/build/project-0147aca016480b9d/out"
+ ),
Some("custom".into()),
));
}
diff -Nru cargo-0.58.0/vendor/autocfg/tests/rustflags.rs cargo-0.60.0ubuntu1/vendor/autocfg/tests/rustflags.rs
--- cargo-0.58.0/vendor/autocfg/tests/rustflags.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/autocfg/tests/rustflags.rs 2022-04-20 13:48:09.000000000 +0000
@@ -2,18 +2,32 @@
use std::env;
-/// Tests that autocfg uses the RUSTFLAGS environment variable when running
-/// rustc.
+/// Tests that autocfg uses the RUSTFLAGS or CARGO_ENCODED_RUSTFLAGS
+/// environment variables when running rustc.
#[test]
fn test_with_sysroot() {
// Use the same path as this test binary.
let dir = env::current_exe().unwrap().parent().unwrap().to_path_buf();
- env::set_var("RUSTFLAGS", &format!("-L {}", dir.display()));
env::set_var("OUT_DIR", &format!("{}", dir.display()));
- // Ensure HOST != TARGET.
- env::set_var("HOST", "lol");
+ // If we have encoded rustflags, they take precedence, even if empty.
+ env::set_var("CARGO_ENCODED_RUSTFLAGS", "");
+ env::set_var("RUSTFLAGS", &format!("-L {}", dir.display()));
+ let ac = autocfg::AutoCfg::new().unwrap();
+ assert!(ac.probe_sysroot_crate("std"));
+ assert!(!ac.probe_sysroot_crate("autocfg"));
+ // Now try again with useful encoded args.
+ env::set_var(
+ "CARGO_ENCODED_RUSTFLAGS",
+ &format!("-L\x1f{}", dir.display()),
+ );
+ let ac = autocfg::AutoCfg::new().unwrap();
+ assert!(ac.probe_sysroot_crate("autocfg"));
+
+ // Try the old-style RUSTFLAGS, ensuring HOST != TARGET.
+ env::remove_var("CARGO_ENCODED_RUSTFLAGS");
+ env::set_var("HOST", "lol");
let ac = autocfg::AutoCfg::new().unwrap();
assert!(ac.probe_sysroot_crate("autocfg"));
}
diff -Nru cargo-0.58.0/vendor/bitflags/debian/patches/disable-tests-permission-denied.patch cargo-0.60.0ubuntu1/vendor/bitflags/debian/patches/disable-tests-permission-denied.patch
--- cargo-0.58.0/vendor/bitflags/debian/patches/disable-tests-permission-denied.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/bitflags/debian/patches/disable-tests-permission-denied.patch 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,27 @@
+disable compile-fail tests, they fail with a permission denied error.
+in the autopkgtest environment.
+Index: bitflags/tests/compile.rs
+===================================================================
+--- bitflags.orig/tests/compile.rs
++++ bitflags/tests/compile.rs
+@@ -7,13 +7,13 @@ use std::{
+
+ use walkdir::WalkDir;
+
+-#[test]
+-fn fail() {
+- prepare_stderr_files("tests/compile-fail").unwrap();
+-
+- let t = trybuild::TestCases::new();
+- t.compile_fail("tests/compile-fail/**/*.rs");
+-}
++//#[test]
++//fn fail() {
++// prepare_stderr_files("tests/compile-fail").unwrap();
++//
++// let t = trybuild::TestCases::new();
++// t.compile_fail("tests/compile-fail/**/*.rs");
++//}
+
+ #[test]
+ fn pass() {
diff -Nru cargo-0.58.0/vendor/bitflags/debian/patches/series cargo-0.60.0ubuntu1/vendor/bitflags/debian/patches/series
--- cargo-0.58.0/vendor/bitflags/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/bitflags/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1 @@
+disable-tests-permission-denied.patch
diff -Nru cargo-0.58.0/vendor/bitflags/tests/compile.rs cargo-0.60.0ubuntu1/vendor/bitflags/tests/compile.rs
--- cargo-0.58.0/vendor/bitflags/tests/compile.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/bitflags/tests/compile.rs 2022-04-20 13:48:09.000000000 +0000
@@ -7,13 +7,13 @@
use walkdir::WalkDir;
-#[test]
-fn fail() {
- prepare_stderr_files("tests/compile-fail").unwrap();
-
- let t = trybuild::TestCases::new();
- t.compile_fail("tests/compile-fail/**/*.rs");
-}
+//#[test]
+//fn fail() {
+// prepare_stderr_files("tests/compile-fail").unwrap();
+//
+// let t = trybuild::TestCases::new();
+// t.compile_fail("tests/compile-fail/**/*.rs");
+//}
#[test]
fn pass() {
diff -Nru cargo-0.58.0/vendor/cc/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/cc/.cargo-checksum.json
--- cargo-0.58.0/vendor/cc/.cargo-checksum.json 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"}
\ No newline at end of file
+{"files":{},"package":"2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/cc/Cargo.lock cargo-0.60.0ubuntu1/vendor/cc/Cargo.lock
--- cargo-0.58.0/vendor/cc/Cargo.lock 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/Cargo.lock 2022-04-20 13:48:09.000000000 +0000
@@ -10,7 +10,7 @@
[[package]]
name = "cc"
-version = "1.0.72"
+version = "1.0.73"
dependencies = [
"jobserver",
"tempfile",
@@ -23,76 +23,37 @@
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
-name = "getrandom"
-version = "0.2.3"
+name = "fastrand"
+version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
+checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
dependencies = [
- "cfg-if",
- "libc",
- "wasi",
+ "instant",
]
[[package]]
-name = "jobserver"
-version = "0.1.24"
+name = "instant"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
+checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
- "libc",
+ "cfg-if",
]
[[package]]
-name = "libc"
-version = "0.2.107"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
-
-[[package]]
-name = "rand"
-version = "0.8.4"
+name = "jobserver"
+version = "0.1.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
+checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
dependencies = [
"libc",
- "rand_chacha",
- "rand_core",
- "rand_hc",
]
[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
-dependencies = [
- "getrandom",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.3.1"
+name = "libc"
+version = "0.2.118"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
-dependencies = [
- "rand_core",
-]
+checksum = "06e509672465a0504304aa87f9f176f2b2b716ed8fb105ebe5c02dc6dce96a94"
[[package]]
name = "redox_syscall"
@@ -114,25 +75,19 @@
[[package]]
name = "tempfile"
-version = "3.2.0"
+version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
+checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [
"cfg-if",
+ "fastrand",
"libc",
- "rand",
"redox_syscall",
"remove_dir_all",
"winapi",
]
[[package]]
-name = "wasi"
-version = "0.10.2+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
-
-[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff -Nru cargo-0.58.0/vendor/cc/Cargo.toml cargo-0.60.0ubuntu1/vendor/cc/Cargo.toml
--- cargo-0.58.0/vendor/cc/Cargo.toml 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "cc"
-version = "1.0.72"
+version = "1.0.73"
authors = ["Alex Crichton "]
exclude = ["/.github", "/.travis.yml", "/appveyor.yml"]
description = "A build-time dependency for Cargo build scripts to assist in invoking the native\nC compiler to compile native C code into a static archive to be linked into Rust\ncode.\n"
diff -Nru cargo-0.58.0/vendor/cc/debian/patches/use-mfpu-on-armhf.patch cargo-0.60.0ubuntu1/vendor/cc/debian/patches/use-mfpu-on-armhf.patch
--- cargo-0.58.0/vendor/cc/debian/patches/use-mfpu-on-armhf.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/debian/patches/use-mfpu-on-armhf.patch 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,16 @@
+The upstream code uses -march but not -mfpu on debian armhf, this works
+with gcc-10 but produces an error with gcc-11, set mfpu to fix this.
+
+--- a/src/lib.rs 1973-11-29 21:33:09.000000000 +0000
++++ b/src/lib.rs 2021-10-23 23:05:21.409460780 +0000
+@@ -1638,6 +1638,10 @@
+ && (target.contains("-linux-") || target.contains("-kmc-solid_"))
+ {
+ cmd.args.push("-march=armv7-a".into());
++ if target.ends_with("eabihf") {
++ // lowest common denominator FPU
++ cmd.args.push("-mfpu=vfpv3-d16".into());
++ }
+ }
+
+ // (x86 Android doesn't say "eabi")
diff -Nru cargo-0.58.0/vendor/cc/src/lib.rs cargo-0.60.0ubuntu1/vendor/cc/src/lib.rs
--- cargo-0.58.0/vendor/cc/src/lib.rs 2022-01-21 02:49:13.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/src/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -62,7 +62,7 @@
use std::fmt::{self, Display};
use std::fs;
use std::io::{self, BufRead, BufReader, Read, Write};
-use std::path::{Path, PathBuf};
+use std::path::{Component, Path, PathBuf};
use std::process::{Child, Command, Stdio};
use std::sync::{Arc, Mutex};
use std::thread::{self, JoinHandle};
@@ -139,6 +139,8 @@
ToolExecError,
/// Error occurred due to missing external tools.
ToolNotFound,
+ /// One of the function arguments failed validation.
+ InvalidArgument,
}
/// Represents an internal error that occurred, with an explanation.
@@ -408,7 +410,7 @@
self
}
- /// Add an arbitrary flag to the invocation of the compiler
+ /// Add a flag to the invocation of the ar
///
/// # Example
///
@@ -419,7 +421,6 @@
/// .ar_flag("/NODEFAULTLIB:libc.dll")
/// .compile("foo");
/// ```
-
pub fn ar_flag(&mut self, flag: &str) -> &mut Build {
self.ar_flags.push(flag.to_string());
self
@@ -944,6 +945,17 @@
///
/// This will return a result instead of panicing; see compile() for the complete description.
pub fn try_compile(&self, output: &str) -> Result<(), Error> {
+ let mut output_components = Path::new(output).components();
+ match (output_components.next(), output_components.next()) {
+ (Some(Component::Normal(_)), None) => {}
+ _ => {
+ return Err(Error::new(
+ ErrorKind::InvalidArgument,
+ "argument of `compile` must be a single normal path component",
+ ));
+ }
+ }
+
let (lib_name, gnu_lib_name) = if output.starts_with("lib") && output.ends_with(".a") {
(&output[3..output.len() - 2], output.to_owned())
} else {
@@ -1067,10 +1079,35 @@
/// Run the compiler, generating the file `output`
///
- /// The name `output` should be the name of the library. For backwards compatibility,
- /// the `output` may start with `lib` and end with `.a`. The Rust compiler will create
- /// the assembly with the lib prefix and .a extension. MSVC will create a file without prefix,
- /// ending with `.lib`.
+ /// # Library name
+ ///
+ /// The `output` string argument determines the file name for the compiled
+ /// library. The Rust compiler will create an assembly named "lib"+output+".a".
+ /// MSVC will create a file named output+".lib".
+ ///
+ /// The choice of `output` is close to arbitrary, but:
+ ///
+ /// - must be nonempty,
+ /// - must not contain a path separator (`/`),
+ /// - must be unique across all `compile` invocations made by the same build
+ /// script.
+ ///
+ /// If your build script compiles a single source file, the base name of
+ /// that source file would usually be reasonable:
+ ///
+ /// ```no_run
+ /// cc::Build::new().file("blobstore.c").compile("blobstore");
+ /// ```
+ ///
+ /// Compiling multiple source files, some people use their crate's name, or
+ /// their crate's name + "-cc".
+ ///
+ /// Otherwise, please use your imagination.
+ ///
+ /// For backwards compatibility, if `output` starts with "lib" *and* ends
+ /// with ".a", a second "lib" prefix and ".a" suffix do not get added on,
+ /// but this usage is deprecated; please omit `lib` and `.a` in the argument
+ /// that you pass.
///
/// # Panics
///
@@ -1566,6 +1603,8 @@
cmd.args.push("--target=x86_64-unknown-windows-gnu".into());
} else if target.contains("i686") {
cmd.args.push("--target=i686-unknown-windows-gnu".into())
+ } else if target.contains("aarch64") {
+ cmd.args.push("--target=aarch64-unknown-windows-gnu".into())
}
} else {
cmd.args.push(format!("--target={}", target).into());
@@ -1788,6 +1827,12 @@
if target.contains("linux") && arch.starts_with("64") {
cmd.args.push(("-march=rv64gc").into());
cmd.args.push("-mabi=lp64d".into());
+ } else if target.contains("freebsd") && arch.starts_with("64") {
+ cmd.args.push(("-march=rv64gc").into());
+ cmd.args.push("-mabi=lp64d".into());
+ } else if target.contains("openbsd") && arch.starts_with("64") {
+ cmd.args.push(("-march=rv64gc").into());
+ cmd.args.push("-mabi=lp64d".into());
} else if target.contains("linux") && arch.starts_with("32") {
cmd.args.push(("-march=rv32gc").into());
cmd.args.push("-mabi=ilp32d".into());
@@ -2501,6 +2546,8 @@
.as_ref()
.map(|s| s.trim_right_matches('-').to_owned());
cross_compile.or(match &target[..] {
+ "aarch64-pc-windows-gnu" => Some("aarch64-w64-mingw32"),
+ "aarch64-uwp-windows-gnu" => Some("aarch64-w64-mingw32"),
"aarch64-unknown-linux-gnu" => Some("aarch64-linux-gnu"),
"aarch64-unknown-linux-musl" => Some("aarch64-linux-musl"),
"aarch64-unknown-netbsd" => Some("aarch64--netbsd"),
diff -Nru cargo-0.58.0/vendor/cc/src/windows_registry.rs cargo-0.60.0ubuntu1/vendor/cc/src/windows_registry.rs
--- cargo-0.58.0/vendor/cc/src/windows_registry.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/src/windows_registry.rs 2022-04-20 13:48:09.000000000 +0000
@@ -134,7 +134,9 @@
_ => {
// Check for the presence of a specific registry key
// that indicates visual studio is installed.
- if impl_::has_msbuild_version("16.0") {
+ if impl_::has_msbuild_version("17.0") {
+ Ok(VsVers::Vs17)
+ } else if impl_::has_msbuild_version("16.0") {
Ok(VsVers::Vs16)
} else if impl_::has_msbuild_version("15.0") {
Ok(VsVers::Vs15)
@@ -250,18 +252,22 @@
}
}
+ fn find_msbuild_vs17(target: &str) -> Option {
+ find_tool_in_vs16plus_path(r"MSBuild\Current\Bin\MSBuild.exe", target, "17")
+ }
+
#[allow(bare_trait_objects)]
- fn vs16_instances(target: &str) -> Box> {
+ fn vs16plus_instances(target: &str, version: &'static str) -> Box> {
let instances = if let Some(instances) = vs15plus_instances(target) {
instances
} else {
return Box::new(iter::empty());
};
- Box::new(instances.into_iter().filter_map(|instance| {
+ Box::new(instances.into_iter().filter_map(move |instance| {
let installation_name = instance.installation_name()?;
- if installation_name.starts_with("VisualStudio/16.") {
+ if installation_name.starts_with(&format!("VisualStudio/{}.", version)) {
Some(instance.installation_path()?)
- } else if installation_name.starts_with("VisualStudioPreview/16.") {
+ } else if installation_name.starts_with(&format!("VisualStudioPreview/{}.", version)) {
Some(instance.installation_path()?)
} else {
None
@@ -269,8 +275,8 @@
}))
}
- fn find_tool_in_vs16_path(tool: &str, target: &str) -> Option {
- vs16_instances(target)
+ fn find_tool_in_vs16plus_path(tool: &str, target: &str, version: &'static str) -> Option {
+ vs16plus_instances(target, version)
.filter_map(|path| {
let path = path.join(tool);
if !path.is_file() {
@@ -289,7 +295,7 @@
}
fn find_msbuild_vs16(target: &str) -> Option {
- find_tool_in_vs16_path(r"MSBuild\Current\Bin\MSBuild.exe", target)
+ find_tool_in_vs16plus_path(r"MSBuild\Current\Bin\MSBuild.exe", target, "16")
}
// In MSVC 15 (2017) MS once again changed the scheme for locating
@@ -663,7 +669,15 @@
// only need to bother checking x64, making this code a tiny bit simpler.
// Like we do for the Universal CRT, we sort the possibilities
// asciibetically to find the newest one as that is what vcvars does.
+ // Before doing that, we check the "WindowsSdkDir" and "WindowsSDKVersion"
+ // environment variables set by vcvars to use the environment sdk version
+ // if one is already configured.
fn get_sdk10_dir() -> Option<(PathBuf, String)> {
+ if let (Ok(root), Ok(version)) = (env::var("WindowsSdkDir"), env::var("WindowsSDKVersion"))
+ {
+ return Some((root.into(), version.trim_end_matches('\\').to_string()));
+ }
+
let key = r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0";
let key = LOCAL_MACHINE.open(key.as_ref()).ok()?;
let root = key.query_str("InstallationFolder").ok()?;
@@ -816,6 +830,11 @@
pub fn has_msbuild_version(version: &str) -> bool {
match version {
+ "17.0" => {
+ find_msbuild_vs17("x86_64-pc-windows-msvc").is_some()
+ || find_msbuild_vs17("i686-pc-windows-msvc").is_some()
+ || find_msbuild_vs17("aarch64-pc-windows-msvc").is_some()
+ }
"16.0" => {
find_msbuild_vs16("x86_64-pc-windows-msvc").is_some()
|| find_msbuild_vs16("i686-pc-windows-msvc").is_some()
diff -Nru cargo-0.58.0/vendor/cc/tests/support/mod.rs cargo-0.60.0ubuntu1/vendor/cc/tests/support/mod.rs
--- cargo-0.58.0/vendor/cc/tests/support/mod.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cc/tests/support/mod.rs 2022-04-20 13:48:09.000000000 +0000
@@ -62,13 +62,12 @@
}
pub fn shim(&self, name: &str) -> &Test {
- link_or_copy(
- &self.gcc,
- self.td
- .path()
- .join(&format!("{}{}", name, env::consts::EXE_SUFFIX)),
- )
- .unwrap();
+ let name = if name.ends_with(env::consts::EXE_SUFFIX) {
+ name.to_string()
+ } else {
+ format!("{}{}", name, env::consts::EXE_SUFFIX)
+ };
+ link_or_copy(&self.gcc, self.td.path().join(name)).unwrap();
self
}
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/.cargo-checksum.json
--- cargo-0.58.0/vendor/cfg-if-0.1.10/.cargo-checksum.json 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-{"files":{},"package":"4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/Cargo.toml cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/Cargo.toml
--- cargo-0.58.0/vendor/cfg-if-0.1.10/Cargo.toml 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/Cargo.toml 1970-01-01 00:00:00.000000000 +0000
@@ -1,36 +0,0 @@
-# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
-#
-# When uploading crates to the registry Cargo will automatically
-# "normalize" Cargo.toml files for maximal compatibility
-# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
-#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
-
-[package]
-edition = "2018"
-name = "cfg-if"
-version = "0.1.10"
-authors = ["Alex Crichton "]
-description = "A macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n"
-homepage = "https://github.com/alexcrichton/cfg-if"
-documentation = "https://docs.rs/cfg-if"
-readme = "README.md"
-license = "MIT/Apache-2.0"
-repository = "https://github.com/alexcrichton/cfg-if"
-[dependencies.compiler_builtins]
-version = "0.1.2"
-optional = true
-
-[dependencies.core]
-version = "1.0.0"
-optional = true
-package = "rustc-std-workspace-core"
-
-[features]
-rustc-dep-of-std = ["core", "compiler_builtins"]
-[badges.travis-ci]
-repository = "alexcrichton/cfg-if"
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/LICENSE-APACHE cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/LICENSE-APACHE
--- cargo-0.58.0/vendor/cfg-if-0.1.10/LICENSE-APACHE 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/LICENSE-APACHE 1970-01-01 00:00:00.000000000 +0000
@@ -1,201 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
-Copyright [yyyy] [name of copyright owner]
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/LICENSE-MIT cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/LICENSE-MIT
--- cargo-0.58.0/vendor/cfg-if-0.1.10/LICENSE-MIT 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000
@@ -1,25 +0,0 @@
-Copyright (c) 2014 Alex Crichton
-
-Permission is hereby granted, free of charge, to any
-person obtaining a copy of this software and associated
-documentation files (the "Software"), to deal in the
-Software without restriction, including without
-limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software
-is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice
-shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
-ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
-SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
-IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/README.md cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/README.md
--- cargo-0.58.0/vendor/cfg-if-0.1.10/README.md 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/README.md 1970-01-01 00:00:00.000000000 +0000
@@ -1,47 +0,0 @@
-# cfg-if
-
-[Documentation](https://docs.rs/cfg-if)
-
-A macro to ergonomically define an item depending on a large number of #[cfg]
-parameters. Structured like an if-else chain, the first matching branch is the
-item that gets emitted.
-
-```toml
-[dependencies]
-cfg-if = "0.1"
-```
-
-## Example
-
-```rust
-cfg_if::cfg_if! {
- if #[cfg(unix)] {
- fn foo() { /* unix specific functionality */ }
- } else if #[cfg(target_pointer_width = "32")] {
- fn foo() { /* non-unix, 32-bit functionality */ }
- } else {
- fn foo() { /* fallback implementation */ }
- }
-}
-
-fn main() {
- foo();
-}
-```
-
-# License
-
-This project is licensed under either of
-
- * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
- http://www.apache.org/licenses/LICENSE-2.0)
- * MIT license ([LICENSE-MIT](LICENSE-MIT) or
- http://opensource.org/licenses/MIT)
-
-at your option.
-
-### Contribution
-
-Unless you explicitly state otherwise, any contribution intentionally submitted
-for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be
-dual licensed as above, without any additional terms or conditions.
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/src/lib.rs cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/src/lib.rs
--- cargo-0.58.0/vendor/cfg-if-0.1.10/src/lib.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/src/lib.rs 1970-01-01 00:00:00.000000000 +0000
@@ -1,176 +0,0 @@
-//! A macro for defining `#[cfg]` if-else statements.
-//!
-//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C
-//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases,
-//! emitting the implementation which matches first.
-//!
-//! This allows you to conveniently provide a long list `#[cfg]`'d blocks of code
-//! without having to rewrite each clause multiple times.
-//!
-//! # Example
-//!
-//! ```
-//! cfg_if::cfg_if! {
-//! if #[cfg(unix)] {
-//! fn foo() { /* unix specific functionality */ }
-//! } else if #[cfg(target_pointer_width = "32")] {
-//! fn foo() { /* non-unix, 32-bit functionality */ }
-//! } else {
-//! fn foo() { /* fallback implementation */ }
-//! }
-//! }
-//!
-//! # fn main() {}
-//! ```
-
-#![no_std]
-#![doc(html_root_url = "https://docs.rs/cfg-if")]
-#![deny(missing_docs)]
-#![cfg_attr(test, deny(warnings))]
-
-/// The main macro provided by this crate. See crate documentation for more
-/// information.
-#[macro_export]
-macro_rules! cfg_if {
- // match if/else chains with a final `else`
- ($(
- if #[cfg($($meta:meta),*)] { $($tokens:tt)* }
- ) else * else {
- $($tokens2:tt)*
- }) => {
- $crate::cfg_if! {
- @__items
- () ;
- $( ( ($($meta),*) ($($tokens)*) ), )*
- ( () ($($tokens2)*) ),
- }
- };
-
- // match if/else chains lacking a final `else`
- (
- if #[cfg($($i_met:meta),*)] { $($i_tokens:tt)* }
- $(
- else if #[cfg($($e_met:meta),*)] { $($e_tokens:tt)* }
- )*
- ) => {
- $crate::cfg_if! {
- @__items
- () ;
- ( ($($i_met),*) ($($i_tokens)*) ),
- $( ( ($($e_met),*) ($($e_tokens)*) ), )*
- ( () () ),
- }
- };
-
- // Internal and recursive macro to emit all the items
- //
- // Collects all the negated cfgs in a list at the beginning and after the
- // semicolon is all the remaining items
- (@__items ($($not:meta,)*) ; ) => {};
- (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => {
- // Emit all items within one block, applying an appropriate #[cfg]. The
- // #[cfg] will require all `$m` matchers specified and must also negate
- // all previous matchers.
- #[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* }
-
- // Recurse to emit all other items in `$rest`, and when we do so add all
- // our `$m` matchers to the list of `$not` matchers as future emissions
- // will have to negate everything we just matched as well.
- $crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* }
- };
-
- // Internal macro to make __apply work out right for different match types,
- // because of how macros matching/expand stuff.
- (@__identity $($tokens:tt)*) => {
- $($tokens)*
- };
-}
-
-#[cfg(test)]
-mod tests {
- cfg_if! {
- if #[cfg(test)] {
- use core::option::Option as Option2;
- fn works1() -> Option2 { Some(1) }
- } else {
- fn works1() -> Option { None }
- }
- }
-
- cfg_if! {
- if #[cfg(foo)] {
- fn works2() -> bool { false }
- } else if #[cfg(test)] {
- fn works2() -> bool { true }
- } else {
- fn works2() -> bool { false }
- }
- }
-
- cfg_if! {
- if #[cfg(foo)] {
- fn works3() -> bool { false }
- } else {
- fn works3() -> bool { true }
- }
- }
-
- cfg_if! {
- if #[cfg(test)] {
- use core::option::Option as Option3;
- fn works4() -> Option3 { Some(1) }
- }
- }
-
- cfg_if! {
- if #[cfg(foo)] {
- fn works5() -> bool { false }
- } else if #[cfg(test)] {
- fn works5() -> bool { true }
- }
- }
-
- #[test]
- fn it_works() {
- assert!(works1().is_some());
- assert!(works2());
- assert!(works3());
- assert!(works4().is_some());
- assert!(works5());
- }
-
- #[test]
- #[allow(clippy::assertions_on_constants)]
- fn test_usage_within_a_function() {
- cfg_if! {if #[cfg(debug_assertions)] {
- // we want to put more than one thing here to make sure that they
- // all get configured properly.
- assert!(cfg!(debug_assertions));
- assert_eq!(4, 2+2);
- } else {
- assert!(works1().is_some());
- assert_eq!(10, 5+5);
- }}
- }
-
- trait Trait {
- fn blah(&self);
- }
-
- #[allow(dead_code)]
- struct Struct;
-
- impl Trait for Struct {
- cfg_if! {
- if #[cfg(feature = "blah")] {
- fn blah(&self) {
- unimplemented!();
- }
- } else {
- fn blah(&self) {
- unimplemented!();
- }
- }
- }
- }
-}
diff -Nru cargo-0.58.0/vendor/cfg-if-0.1.10/tests/xcrate.rs cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/tests/xcrate.rs
--- cargo-0.58.0/vendor/cfg-if-0.1.10/tests/xcrate.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/cfg-if-0.1.10/tests/xcrate.rs 1970-01-01 00:00:00.000000000 +0000
@@ -1,14 +0,0 @@
-cfg_if::cfg_if! {
- if #[cfg(foo)] {
- fn works() -> bool { false }
- } else if #[cfg(test)] {
- fn works() -> bool { true }
- } else {
- fn works() -> bool { false }
- }
-}
-
-#[test]
-fn smoke() {
- assert!(works());
-}
diff -Nru cargo-0.58.0/vendor/clap/Cargo.toml cargo-0.60.0ubuntu1/vendor/clap/Cargo.toml
--- cargo-0.58.0/vendor/clap/Cargo.toml 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/clap/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -64,8 +64,12 @@
[dependencies.bitflags]
version = "1.0"
+[dependencies.clippy]
+version = "~0.0.166"
+optional = true
+
[dependencies.strsim]
-version = ">= 0.7, < 0.10"
+version = "0.8"
optional = true
[dependencies.term_size]
@@ -83,7 +87,7 @@
optional = true
[dependencies.yaml-rust]
-version = ">= 0.3.5, < 0.5"
+version = "0.3.5"
optional = true
[dev-dependencies.lazy_static]
version = "1.3"
@@ -106,7 +110,7 @@
wrap_help = ["term_size", "textwrap/term_size"]
yaml = ["yaml-rust"]
[target."cfg(not(windows))".dependencies.ansi_term]
-version = ">= 0.11, < 0.13"
+version = "0.12"
optional = true
[badges.appveyor]
repository = "clap-rs/clap"
diff -Nru cargo-0.58.0/vendor/clap/debian/patches/disable-criterion.patch cargo-0.60.0ubuntu1/vendor/clap/debian/patches/disable-criterion.patch
--- cargo-0.58.0/vendor/clap/debian/patches/disable-criterion.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/clap/debian/patches/disable-criterion.patch 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,85 @@
+--- clap.orig/benches/01_default.rs
++++ clap/benches/01_default.rs
+@@ -1 +1 @@
+-use clap::Command;
++/*use clap::Command;
+@@ -15 +15,5 @@
+-criterion_main!(benches);
++criterion_main!(benches);*/
++
++fn main() {
++ println!("this bench is disabled because clap is not in Debian");
++}
+--- clap.orig/benches/02_simple.rs
++++ clap/benches/02_simple.rs
+@@ -1 +1 @@
+-use clap::{arg, Arg, Command};
++/*use clap::{arg, Arg, Command};
+@@ -104 +104,5 @@
+-criterion_main!(benches);
++criterion_main!(benches);*/
++
++fn main() {
++ println!("this bench is disabled because clap is not in Debian");
++}
+--- clap.orig/benches/03_complex.rs
++++ clap/benches/03_complex.rs
+@@ -1 +1 @@
+-use clap::{arg, Arg, Command};
++/*use clap::{arg, Arg, Command};
+@@ -307 +307,5 @@
+-criterion_main!(benches);
++criterion_main!(benches);*/
++
++fn main() {
++ println!("this bench is disabled because clap is not in Debian");
++}
+--- clap.orig/benches/04_new_help.rs
++++ clap/benches/04_new_help.rs
+@@ -1 +1 @@
+-use clap::Command;
++/*use clap::Command;
+@@ -223 +223,5 @@
+-criterion_main!(benches);
++criterion_main!(benches);*/
++
++fn main() {
++ println!("this bench is disabled because clap is not in Debian");
++}
+--- clap.orig/benches/05_ripgrep.rs
++++ clap/benches/05_ripgrep.rs
+@@ -5,3 +5,3 @@
+
+-use clap::{Arg, Command};
++/*use clap::{Arg, Command};
+ use criterion::{criterion_group, criterion_main, Criterion};
+@@ -951,2 +951,6 @@
+ );
+-criterion_main!(benches);
++criterion_main!(benches);*/
++
++fn main() {
++ println!("this bench is disabled because clap is not in Debian");
++}
+--- clap.orig/benches/06_rustup.rs
++++ clap/benches/06_rustup.rs
+@@ -4,3 +4,3 @@
+
+-use clap::{AppSettings, Arg, ArgGroup, Command};
++/*use clap::{AppSettings, Arg, ArgGroup, Command};
+ use criterion::{criterion_group, criterion_main, Criterion};
+@@ -411,2 +411,6 @@
+
+-criterion_main!(benches);
++criterion_main!(benches);*/
++
++fn main() {
++ println!("this bench is disabled because clap is not in Debian");
++}
+--- clap.orig/Cargo.toml
++++ clap/Cargo.toml
+@@ -391,4 +391,2 @@
+ optional = true
+-[dev-dependencies.criterion]
+-version = "0.3.2"
+
diff -Nru cargo-0.58.0/vendor/clap/debian/patches/disable-trycmd.diff cargo-0.60.0ubuntu1/vendor/clap/debian/patches/disable-trycmd.diff
--- cargo-0.58.0/vendor/clap/debian/patches/disable-trycmd.diff 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/clap/debian/patches/disable-trycmd.diff 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,16 @@
+Index: clap/Cargo.toml
+===================================================================
+--- clap.orig/Cargo.toml
++++ clap/Cargo.toml
+@@ -402,11 +402,6 @@ version = "1"
+ [dev-dependencies.trybuild]
+ version = "1.0.18"
+
+-[dev-dependencies.trycmd]
+-version = "0.12"
+-features = ["color-auto", "diff", "examples"]
+-default-features = false
+-
+ [features]
+ cargo = ["lazy_static"]
+ color = ["atty", "termcolor"]
diff -Nru cargo-0.58.0/vendor/clap/debian/patches/no-clippy.patch cargo-0.60.0ubuntu1/vendor/clap/debian/patches/no-clippy.patch
--- cargo-0.58.0/vendor/clap/debian/patches/no-clippy.patch 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/clap/debian/patches/no-clippy.patch 2022-04-20 13:48:09.000000000 +0000
@@ -1,13 +0,0 @@
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -64,10 +64,6 @@
- [dependencies.bitflags]
- version = "1.0"
-
--[dependencies.clippy]
--version = "~0.0.166"
--optional = true
--
- [dependencies.strsim]
- version = "0.8"
- optional = true
diff -Nru cargo-0.58.0/vendor/clap/debian/patches/relax-dep-versions.patch cargo-0.60.0ubuntu1/vendor/clap/debian/patches/relax-dep-versions.patch
--- cargo-0.58.0/vendor/clap/debian/patches/relax-dep-versions.patch 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/clap/debian/patches/relax-dep-versions.patch 2022-04-20 13:48:09.000000000 +0000
@@ -1,29 +1,22 @@
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -65,7 +65,7 @@
- version = "1.0"
-
- [dependencies.strsim]
--version = "0.8"
-+version = ">= 0.7, < 0.10"
+Index: clap/Cargo.toml
+===================================================================
+--- clap.orig/Cargo.toml
++++ clap/Cargo.toml
+@@ -352,7 +352,7 @@ version = "3.1.4"
optional = true
- [dependencies.term_size]
-@@ -83,7 +83,7 @@
- optional = true
+ [dependencies.indexmap]
+-version = "1.0"
++version = "1"
- [dependencies.yaml-rust]
--version = "0.3.5"
-+version = ">= 0.3.5, < 0.5"
+ [dependencies.lazy_static]
+ version = "1"
+@@ -366,7 +366,7 @@ version = "1.0"
optional = true
- [dev-dependencies.lazy_static]
- version = "1.3"
-@@ -106,7 +106,7 @@
- wrap_help = ["term_size", "textwrap/term_size"]
- yaml = ["yaml-rust"]
- [target."cfg(not(windows))".dependencies.ansi_term]
--version = "0.12"
-+version = ">= 0.11, < 0.13"
+
+ [dependencies.strsim]
+-version = "0.10"
++version = "0.9"
optional = true
- [badges.appveyor]
- repository = "clap-rs/clap"
+
+ [dependencies.termcolor]
diff -Nru cargo-0.58.0/vendor/clap/debian/patches/series cargo-0.60.0ubuntu1/vendor/clap/debian/patches/series
--- cargo-0.58.0/vendor/clap/debian/patches/series 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/clap/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -1,2 +1 @@
no-clippy.patch
-relax-dep-versions.patch
diff -Nru cargo-0.58.0/vendor/core-foundation/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/core-foundation/.cargo-checksum.json
--- cargo-0.58.0/vendor/core-foundation/.cargo-checksum.json 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/core-foundation/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3"}
\ No newline at end of file
+{"files":{},"package":"194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/core-foundation/Cargo.toml cargo-0.60.0ubuntu1/vendor/core-foundation/Cargo.toml
--- cargo-0.58.0/vendor/core-foundation/Cargo.toml 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/core-foundation/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -3,16 +3,15 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
name = "core-foundation"
-version = "0.9.2"
+version = "0.9.3"
authors = ["The Servo Project Developers"]
description = "Bindings to Core Foundation for macOS"
homepage = "https://github.com/servo/core-foundation-rs"
@@ -27,7 +26,7 @@
optional = true
[dependencies.core-foundation-sys]
-version = "0.8.0"
+version = "0.8.3"
[dependencies.libc]
version = "0.2"
diff -Nru cargo-0.58.0/vendor/core-foundation/src/filedescriptor.rs cargo-0.60.0ubuntu1/vendor/core-foundation/src/filedescriptor.rs
--- cargo-0.58.0/vendor/core-foundation/src/filedescriptor.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/core-foundation/src/filedescriptor.rs 2022-04-20 13:48:09.000000000 +0000
@@ -114,22 +114,6 @@
use runloop::{CFRunLoop};
#[test]
- fn test_consumed() {
- let path = CString::new("/dev/null").unwrap();
- let raw_fd = unsafe { libc::open(path.as_ptr(), O_RDWR, 0) };
- let cf_fd = CFFileDescriptor::new(raw_fd, true, never_callback, None);
- assert!(cf_fd.is_some());
- let cf_fd = cf_fd.unwrap();
-
- assert!(cf_fd.valid());
- cf_fd.invalidate();
- assert!(!cf_fd.valid());
-
- // close() should fail
- assert_eq!(unsafe { libc::close(raw_fd) }, -1);
- }
-
- #[test]
fn test_unconsumed() {
let path = CString::new("/dev/null").unwrap();
let raw_fd = unsafe { libc::open(path.as_ptr(), O_RDWR, 0) };
diff -Nru cargo-0.58.0/vendor/core-foundation/src/runloop.rs cargo-0.60.0ubuntu1/vendor/core-foundation/src/runloop.rs
--- cargo-0.58.0/vendor/core-foundation/src/runloop.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/core-foundation/src/runloop.rs 2022-04-20 13:48:09.000000000 +0000
@@ -26,6 +26,14 @@
impl_TCFType!(CFRunLoop, CFRunLoopRef, CFRunLoopGetTypeID);
impl_CFTypeDescription!(CFRunLoop);
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub enum CFRunLoopRunResult {
+ Finished = 1,
+ Stopped = 2,
+ TimedOut = 3,
+ HandledSource = 4,
+}
+
impl CFRunLoop {
pub fn get_current() -> CFRunLoop {
unsafe {
@@ -47,6 +55,24 @@
}
}
+ pub fn run_in_mode(
+ mode: CFStringRef,
+ duration: std::time::Duration,
+ return_after_source_handled: bool,
+ ) -> CFRunLoopRunResult {
+ let seconds = duration.as_secs_f64();
+ let return_after_source_handled = if return_after_source_handled { 1 } else { 0 };
+
+ unsafe {
+ match CFRunLoopRunInMode(mode, seconds, return_after_source_handled) {
+ 2 => CFRunLoopRunResult::Stopped,
+ 3 => CFRunLoopRunResult::TimedOut,
+ 4 => CFRunLoopRunResult::HandledSource,
+ _ => CFRunLoopRunResult::Finished,
+ }
+ }
+ }
+
pub fn stop(&self) {
unsafe {
CFRunLoopStop(self.0);
diff -Nru cargo-0.58.0/vendor/crc32fast/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/crc32fast/.cargo-checksum.json
--- cargo-0.58.0/vendor/crc32fast/.cargo-checksum.json 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crc32fast/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836"}
\ No newline at end of file
+{"files":{},"package":"b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/crc32fast/Cargo.toml cargo-0.60.0ubuntu1/vendor/crc32fast/Cargo.toml
--- cargo-0.58.0/vendor/crc32fast/Cargo.toml 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crc32fast/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -11,7 +11,7 @@
[package]
name = "crc32fast"
-version = "1.3.0"
+version = "1.3.2"
authors = ["Sam Rijs ", "Alex Crichton "]
description = "Fast, SIMD-accelerated CRC32 (IEEE) checksum computation"
readme = "README.md"
diff -Nru cargo-0.58.0/vendor/crc32fast/src/specialized/aarch64.rs cargo-0.60.0ubuntu1/vendor/crc32fast/src/specialized/aarch64.rs
--- cargo-0.58.0/vendor/crc32fast/src/specialized/aarch64.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crc32fast/src/specialized/aarch64.rs 2022-04-20 13:48:09.000000000 +0000
@@ -7,7 +7,7 @@
impl State {
pub fn new(state: u32) -> Option {
- if is_aarch64_feature_detected!("crc") {
+ if std::arch::is_aarch64_feature_detected!("crc") {
// SAFETY: The conditions above ensure that all
// required instructions are supported by the CPU.
Some(Self { state })
diff -Nru cargo-0.58.0/vendor/crc32fast/src/table.rs cargo-0.60.0ubuntu1/vendor/crc32fast/src/table.rs
--- cargo-0.58.0/vendor/crc32fast/src/table.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crc32fast/src/table.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,4 +1,7 @@
-pub const CRC32_TABLE: [[u32; 256]; 16] = [
+// NOTE: This is static instead of const to ensure that indexing into this table
+// doesn't result in large memmoves when in debug mode, which can significantly
+// impact performance.
+pub static CRC32_TABLE: [[u32; 256]; 16] = [
[
0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535,
0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd,
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/build.rs cargo-0.60.0ubuntu1/vendor/crossbeam-utils/build.rs
--- cargo-0.58.0/vendor/crossbeam-utils/build.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/build.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,9 +1,3 @@
-#![warn(rust_2018_idioms)]
-
-use std::env;
-
-include!("no_atomic.rs");
-
// The rustc-cfg listed below are considered public API, but it is *unstable*
// and outside of the normal semver guarantees:
//
@@ -25,10 +19,15 @@
// need to enable it manually when building for custom targets or using
// non-cargo build systems that don't run the build script.
//
-// With the exceptions mentioned above, the rustc-cfg strings below are
-// *not* public API. Please let us know by opening a GitHub issue if your build
-// environment requires some way to enable these cfgs other than by executing
-// our build script.
+// With the exceptions mentioned above, the rustc-cfg emitted by the build
+// script are *not* public API.
+
+#![warn(rust_2018_idioms)]
+
+use std::env;
+
+include!("no_atomic.rs");
+
fn main() {
let target = match env::var("TARGET") {
Ok(target) => target,
@@ -55,7 +54,7 @@
} else if NO_ATOMIC_64.contains(&&*target) {
println!("cargo:rustc-cfg=crossbeam_no_atomic_64");
} else {
- // Otherwise, assuming `"max-atomic-width" == 64`.
+ // Otherwise, assuming `"max-atomic-width" == 64` or `"max-atomic-width" == 128`.
}
println!("cargo:rerun-if-changed=no_atomic.rs");
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/crossbeam-utils/.cargo-checksum.json
--- cargo-0.58.0/vendor/crossbeam-utils/.cargo-checksum.json 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"cfcae03edb34f947e64acdb1c33ec169824e20657e9ecb61cef6c8c74dcb8120"}
\ No newline at end of file
+{"files":{},"package":"0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/Cargo.toml cargo-0.60.0ubuntu1/vendor/crossbeam-utils/Cargo.toml
--- cargo-0.58.0/vendor/crossbeam-utils/Cargo.toml 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -13,19 +13,31 @@
edition = "2018"
rust-version = "1.36"
name = "crossbeam-utils"
-version = "0.8.6"
+version = "0.8.8"
description = "Utilities for concurrent programming"
homepage = "https://github.com/crossbeam-rs/crossbeam/tree/master/crossbeam-utils"
-keywords = ["scoped", "thread", "atomic", "cache"]
-categories = ["algorithms", "concurrency", "data-structures", "no-std"]
+keywords = [
+ "scoped",
+ "thread",
+ "atomic",
+ "cache",
+]
+categories = [
+ "algorithms",
+ "concurrency",
+ "data-structures",
+ "no-std",
+]
license = "MIT OR Apache-2.0"
repository = "https://github.com/crossbeam-rs/crossbeam"
+
[dependencies.cfg-if]
version = "1"
[dependencies.lazy_static]
version = "1.4.0"
optional = true
+
[dev-dependencies.rand]
version = ">= 0.7, < 0.9"
@@ -36,6 +48,7 @@
default = ["std"]
nightly = []
std = ["lazy_static"]
-[target."cfg(crossbeam_loom)".dependencies.loom]
-version = "0.5"
-optional = true
+
+#[target."cfg(crossbeam_loom)".dependencies.loom]
+#version = "0.5"
+#optional = true
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/CHANGELOG.md cargo-0.60.0ubuntu1/vendor/crossbeam-utils/CHANGELOG.md
--- cargo-0.58.0/vendor/crossbeam-utils/CHANGELOG.md 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/CHANGELOG.md 2022-04-20 13:48:09.000000000 +0000
@@ -1,23 +1,43 @@
+# Version 0.8.8
+
+- Fix a bug when unstable `loom` support is enabled. (#787)
+
+# Version 0.8.7
+
+- Add `AtomicCell<{i*,u*}>::{fetch_max,fetch_min}`. (#785)
+- Add `AtomicCell<{i*,u*,bool}>::fetch_nand`. (#785)
+- Fix unsoundness of `AtomicCell<{i,u}64>` arithmetics on 32-bit targets that support `Atomic{I,U}64` (#781)
+
# Version 0.8.6
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Re-add `AtomicCell<{i,u}64>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0 on targets that do not support `Atomic{I,U}64`. (#767)
- Re-add `AtomicCell<{i,u}128>::{fetch_add,fetch_sub,fetch_and,fetch_or,fetch_xor}` that were accidentally removed in 0.8.0. (#767)
# Version 0.8.5
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Add `AtomicCell::fetch_update`. (#704)
- Support targets that do not have atomic CAS on stable Rust. (#698)
# Version 0.8.4
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Bump `loom` dependency to version 0.5. (#686)
# Version 0.8.3
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Make `loom` dependency optional. (#666)
# Version 0.8.2
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Deprecate `AtomicCell::compare_and_swap`. Use `AtomicCell::compare_exchange` instead. (#619)
- Add `Parker::park_deadline`. (#563)
- Improve implementation of `CachePadded`. (#636)
@@ -25,6 +45,8 @@
# Version 0.8.1
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Make `AtomicCell::is_lock_free` always const fn. (#600)
- Fix a bug in `seq_lock_wide`. (#596)
- Remove `const_fn` dependency. (#600)
@@ -32,6 +54,8 @@
# Version 0.8.0
+**Note**: This release has been yanked. See [#781](https://github.com/crossbeam-rs/crossbeam/issues/781) for details.
+
- Bump the minimum supported Rust version to 1.36.
- Remove deprecated `AtomicCell::get_mut()` and `Backoff::is_complete()` methods.
- Remove `alloc` feature.
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/debian/patches/disable-loom.diff cargo-0.60.0ubuntu1/vendor/crossbeam-utils/debian/patches/disable-loom.diff
--- cargo-0.58.0/vendor/crossbeam-utils/debian/patches/disable-loom.diff 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/debian/patches/disable-loom.diff 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,14 @@
+Index: crossbeam-utils/Cargo.toml
+===================================================================
+--- crossbeam-utils.orig/Cargo.toml
++++ crossbeam-utils/Cargo.toml
+@@ -35,6 +35,6 @@ version = ">= 0.7, < 0.9"
+ nightly = []
+ std = ["lazy_static"]
+
+-[target."cfg(crossbeam_loom)".dependencies.loom]
+-version = "0.5"
+-optional = true
++#[target."cfg(crossbeam_loom)".dependencies.loom]
++#version = "0.5"
++#optional = true
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/debian/patches/disable-loom.diff.orig cargo-0.60.0ubuntu1/vendor/crossbeam-utils/debian/patches/disable-loom.diff.orig
--- cargo-0.58.0/vendor/crossbeam-utils/debian/patches/disable-loom.diff.orig 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/debian/patches/disable-loom.diff.orig 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,14 @@
+Index: crossbeam-utils/Cargo.toml
+===================================================================
+--- crossbeam-utils.orig/Cargo.toml
++++ crossbeam-utils/Cargo.toml
+@@ -35,6 +35,6 @@ version = ">= 0.7, < 0.9"
+ default = ["std"]
+ nightly = []
+ std = ["lazy_static"]
+-[target."cfg(crossbeam_loom)".dependencies.loom]
+-version = "0.5"
+-optional = true
++#[target."cfg(crossbeam_loom)".dependencies.loom]
++#version = "0.5"
++#optional = true
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/debian/patches/series cargo-0.60.0ubuntu1/vendor/crossbeam-utils/debian/patches/series
--- cargo-0.58.0/vendor/crossbeam-utils/debian/patches/series 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1,2 @@
relax-dep.diff
+disable-loom.diff
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/no_atomic.rs cargo-0.60.0ubuntu1/vendor/crossbeam-utils/no_atomic.rs
--- cargo-0.58.0/vendor/crossbeam-utils/no_atomic.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/no_atomic.rs 2022-04-20 13:48:09.000000000 +0000
@@ -7,11 +7,13 @@
"bpfel-unknown-none",
"msp430-none-elf",
"riscv32i-unknown-none-elf",
+ "riscv32im-unknown-none-elf",
"riscv32imc-unknown-none-elf",
"thumbv4t-none-eabi",
"thumbv6m-none-eabi",
];
-#[allow(dead_code)]
+
+#[allow(dead_code)] // Only crossbeam-utils uses this.
const NO_ATOMIC_64: &[&str] = &[
"arm-linux-androideabi",
"armebv7r-none-eabi",
@@ -20,19 +22,23 @@
"armv5te-unknown-linux-gnueabi",
"armv5te-unknown-linux-musleabi",
"armv5te-unknown-linux-uclibceabi",
+ "armv6k-nintendo-3ds",
"armv7r-none-eabi",
"armv7r-none-eabihf",
+ "avr-unknown-gnu-atmega328",
"hexagon-unknown-linux-musl",
"m68k-unknown-linux-gnu",
"mips-unknown-linux-gnu",
"mips-unknown-linux-musl",
"mips-unknown-linux-uclibc",
+ "mipsel-sony-psp",
"mipsel-unknown-linux-gnu",
"mipsel-unknown-linux-musl",
"mipsel-unknown-linux-uclibc",
"mipsel-unknown-none",
"mipsisa32r6-unknown-linux-gnu",
"mipsisa32r6el-unknown-linux-gnu",
+ "msp430-none-elf",
"powerpc-unknown-freebsd",
"powerpc-unknown-linux-gnu",
"powerpc-unknown-linux-gnuspe",
@@ -43,23 +49,25 @@
"powerpc-wrs-vxworks-spe",
"riscv32gc-unknown-linux-gnu",
"riscv32gc-unknown-linux-musl",
+ "riscv32i-unknown-none-elf",
+ "riscv32im-unknown-none-elf",
"riscv32imac-unknown-none-elf",
- "riscv32imc-esp-espidf",
+ "riscv32imc-unknown-none-elf",
+ "thumbv4t-none-eabi",
+ "thumbv6m-none-eabi",
"thumbv7em-none-eabi",
"thumbv7em-none-eabihf",
"thumbv7m-none-eabi",
"thumbv8m.base-none-eabi",
"thumbv8m.main-none-eabi",
"thumbv8m.main-none-eabihf",
- "armv6k-nintendo-3ds",
- "mipsel-sony-psp",
- "thumbv4t-none-eabi",
- "thumbv6m-none-eabi",
];
-#[allow(dead_code)]
+
+#[allow(dead_code)] // Only crossbeam-utils uses this.
const NO_ATOMIC: &[&str] = &[
"avr-unknown-gnu-atmega328",
"msp430-none-elf",
"riscv32i-unknown-none-elf",
+ "riscv32im-unknown-none-elf",
"riscv32imc-unknown-none-elf",
];
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/src/atomic/atomic_cell.rs cargo-0.60.0ubuntu1/vendor/crossbeam-utils/src/atomic/atomic_cell.rs
--- cargo-0.58.0/vendor/crossbeam-utils/src/atomic/atomic_cell.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/src/atomic/atomic_cell.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,20 +1,18 @@
// Necessary for implementing atomic methods for `AtomicUnit`
#![allow(clippy::unit_arg)]
-#![allow(clippy::let_unit_value)]
use crate::primitive::sync::atomic::{self, AtomicBool};
use core::cell::UnsafeCell;
+use core::cmp;
use core::fmt;
use core::mem;
use core::sync::atomic::Ordering;
-#[cfg(not(crossbeam_loom))]
use core::ptr;
#[cfg(feature = "std")]
use std::panic::{RefUnwindSafe, UnwindSafe};
-#[cfg(not(crossbeam_loom))]
use super::seq_lock::SeqLock;
/// A thread-safe mutable memory location.
@@ -313,19 +311,11 @@
/// ```
#[inline]
pub fn fetch_add(&self, val: $t) -> $t {
- #[cfg(crossbeam_loom)]
- {
- let _ = val;
- unimplemented!("loom does not support non-atomic atomic ops");
- }
- #[cfg(not(crossbeam_loom))]
- {
- let _guard = lock(self.value.get() as usize).write();
- let value = unsafe { &mut *(self.value.get()) };
- let old = *value;
- *value = value.wrapping_add(val);
- old
- }
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = value.wrapping_add(val);
+ old
}
/// Decrements the current value by `val` and returns the previous value.
@@ -344,19 +334,11 @@
/// ```
#[inline]
pub fn fetch_sub(&self, val: $t) -> $t {
- #[cfg(crossbeam_loom)]
- {
- let _ = val;
- unimplemented!("loom does not support non-atomic atomic ops");
- }
- #[cfg(not(crossbeam_loom))]
- {
- let _guard = lock(self.value.get() as usize).write();
- let value = unsafe { &mut *(self.value.get()) };
- let old = *value;
- *value = value.wrapping_sub(val);
- old
- }
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = value.wrapping_sub(val);
+ old
}
/// Applies bitwise "and" to the current value and returns the previous value.
@@ -373,19 +355,32 @@
/// ```
#[inline]
pub fn fetch_and(&self, val: $t) -> $t {
- #[cfg(crossbeam_loom)]
- {
- let _ = val;
- unimplemented!("loom does not support non-atomic atomic ops");
- }
- #[cfg(not(crossbeam_loom))]
- {
- let _guard = lock(self.value.get() as usize).write();
- let value = unsafe { &mut *(self.value.get()) };
- let old = *value;
- *value &= val;
- old
- }
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value &= val;
+ old
+ }
+
+ /// Applies bitwise "nand" to the current value and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ #[doc = $example]
+ ///
+ /// assert_eq!(a.fetch_nand(3), 7);
+ /// assert_eq!(a.load(), !(7 & 3));
+ /// ```
+ #[inline]
+ pub fn fetch_nand(&self, val: $t) -> $t {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = !(old & val);
+ old
}
/// Applies bitwise "or" to the current value and returns the previous value.
@@ -402,19 +397,11 @@
/// ```
#[inline]
pub fn fetch_or(&self, val: $t) -> $t {
- #[cfg(crossbeam_loom)]
- {
- let _ = val;
- unimplemented!("loom does not support non-atomic atomic ops");
- }
- #[cfg(not(crossbeam_loom))]
- {
- let _guard = lock(self.value.get() as usize).write();
- let value = unsafe { &mut *(self.value.get()) };
- let old = *value;
- *value |= val;
- old
- }
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value |= val;
+ old
}
/// Applies bitwise "xor" to the current value and returns the previous value.
@@ -431,19 +418,55 @@
/// ```
#[inline]
pub fn fetch_xor(&self, val: $t) -> $t {
- #[cfg(crossbeam_loom)]
- {
- let _ = val;
- unimplemented!("loom does not support non-atomic atomic ops");
- }
- #[cfg(not(crossbeam_loom))]
- {
- let _guard = lock(self.value.get() as usize).write();
- let value = unsafe { &mut *(self.value.get()) };
- let old = *value;
- *value ^= val;
- old
- }
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value ^= val;
+ old
+ }
+
+ /// Compares and sets the maximum of the current value and `val`,
+ /// and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ #[doc = $example]
+ ///
+ /// assert_eq!(a.fetch_max(2), 7);
+ /// assert_eq!(a.load(), 7);
+ /// ```
+ #[inline]
+ pub fn fetch_max(&self, val: $t) -> $t {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = cmp::max(old, val);
+ old
+ }
+
+ /// Compares and sets the minimum of the current value and `val`,
+ /// and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ #[doc = $example]
+ ///
+ /// assert_eq!(a.fetch_min(2), 7);
+ /// assert_eq!(a.load(), 2);
+ /// ```
+ #[inline]
+ pub fn fetch_min(&self, val: $t) -> $t {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = cmp::min(old, val);
+ old
}
}
};
@@ -465,8 +488,16 @@
/// ```
#[inline]
pub fn fetch_add(&self, val: $t) -> $t {
- let a = unsafe { &*(self.value.get() as *const $atomic) };
- a.fetch_add(val, Ordering::AcqRel)
+ if can_transmute::<$t, $atomic>() {
+ let a = unsafe { &*(self.value.get() as *const $atomic) };
+ a.fetch_add(val, Ordering::AcqRel)
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = value.wrapping_add(val);
+ old
+ }
}
/// Decrements the current value by `val` and returns the previous value.
@@ -485,8 +516,16 @@
/// ```
#[inline]
pub fn fetch_sub(&self, val: $t) -> $t {
- let a = unsafe { &*(self.value.get() as *const $atomic) };
- a.fetch_sub(val, Ordering::AcqRel)
+ if can_transmute::<$t, $atomic>() {
+ let a = unsafe { &*(self.value.get() as *const $atomic) };
+ a.fetch_sub(val, Ordering::AcqRel)
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = value.wrapping_sub(val);
+ old
+ }
}
/// Applies bitwise "and" to the current value and returns the previous value.
@@ -503,8 +542,42 @@
/// ```
#[inline]
pub fn fetch_and(&self, val: $t) -> $t {
- let a = unsafe { &*(self.value.get() as *const $atomic) };
- a.fetch_and(val, Ordering::AcqRel)
+ if can_transmute::<$t, $atomic>() {
+ let a = unsafe { &*(self.value.get() as *const $atomic) };
+ a.fetch_and(val, Ordering::AcqRel)
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value &= val;
+ old
+ }
+ }
+
+ /// Applies bitwise "nand" to the current value and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ #[doc = $example]
+ ///
+ /// assert_eq!(a.fetch_nand(3), 7);
+ /// assert_eq!(a.load(), !(7 & 3));
+ /// ```
+ #[inline]
+ pub fn fetch_nand(&self, val: $t) -> $t {
+ if can_transmute::<$t, $atomic>() {
+ let a = unsafe { &*(self.value.get() as *const $atomic) };
+ a.fetch_nand(val, Ordering::AcqRel)
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = !(old & val);
+ old
+ }
}
/// Applies bitwise "or" to the current value and returns the previous value.
@@ -521,8 +594,16 @@
/// ```
#[inline]
pub fn fetch_or(&self, val: $t) -> $t {
- let a = unsafe { &*(self.value.get() as *const $atomic) };
- a.fetch_or(val, Ordering::AcqRel)
+ if can_transmute::<$t, $atomic>() {
+ let a = unsafe { &*(self.value.get() as *const $atomic) };
+ a.fetch_or(val, Ordering::AcqRel)
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value |= val;
+ old
+ }
}
/// Applies bitwise "xor" to the current value and returns the previous value.
@@ -539,8 +620,70 @@
/// ```
#[inline]
pub fn fetch_xor(&self, val: $t) -> $t {
- let a = unsafe { &*(self.value.get() as *const $atomic) };
- a.fetch_xor(val, Ordering::AcqRel)
+ if can_transmute::<$t, $atomic>() {
+ let a = unsafe { &*(self.value.get() as *const $atomic) };
+ a.fetch_xor(val, Ordering::AcqRel)
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value ^= val;
+ old
+ }
+ }
+
+ /// Compares and sets the maximum of the current value and `val`,
+ /// and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ #[doc = $example]
+ ///
+ /// assert_eq!(a.fetch_max(9), 7);
+ /// assert_eq!(a.load(), 9);
+ /// ```
+ #[inline]
+ pub fn fetch_max(&self, val: $t) -> $t {
+ if can_transmute::<$t, $atomic>() {
+ // TODO: Atomic*::fetch_max requires Rust 1.45.
+ self.fetch_update(|old| Some(cmp::max(old, val))).unwrap()
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = cmp::max(old, val);
+ old
+ }
+ }
+
+ /// Compares and sets the minimum of the current value and `val`,
+ /// and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ #[doc = $example]
+ ///
+ /// assert_eq!(a.fetch_min(2), 7);
+ /// assert_eq!(a.load(), 2);
+ /// ```
+ #[inline]
+ pub fn fetch_min(&self, val: $t) -> $t {
+ if can_transmute::<$t, $atomic>() {
+ // TODO: Atomic*::fetch_min requires Rust 1.45.
+ self.fetch_update(|old| Some(cmp::min(old, val))).unwrap()
+ } else {
+ let _guard = lock(self.value.get() as usize).write();
+ let value = unsafe { &mut *(self.value.get()) };
+ let old = *value;
+ *value = cmp::min(old, val);
+ old
+ }
}
}
};
@@ -599,6 +742,30 @@
a.fetch_and(val, Ordering::AcqRel)
}
+ /// Applies logical "nand" to the current value and returns the previous value.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use crossbeam_utils::atomic::AtomicCell;
+ ///
+ /// let a = AtomicCell::new(true);
+ ///
+ /// assert_eq!(a.fetch_nand(false), true);
+ /// assert_eq!(a.load(), true);
+ ///
+ /// assert_eq!(a.fetch_nand(true), true);
+ /// assert_eq!(a.load(), false);
+ ///
+ /// assert_eq!(a.fetch_nand(false), false);
+ /// assert_eq!(a.load(), true);
+ /// ```
+ #[inline]
+ pub fn fetch_nand(&self, val: bool) -> bool {
+ let a = unsafe { &*(self.value.get() as *const AtomicBool) };
+ a.fetch_nand(val, Ordering::AcqRel)
+ }
+
/// Applies logical "or" to the current value and returns the previous value.
///
/// # Examples
@@ -679,7 +846,6 @@
/// scalability.
#[inline]
#[must_use]
-#[cfg(not(crossbeam_loom))]
fn lock(addr: usize) -> &'static SeqLock {
// The number of locks is a prime number because we want to make sure `addr % LEN` gets
// dispersed across all locks.
@@ -733,7 +899,6 @@
#[inline]
fn swap(&self, _val: (), _order: Ordering) {}
- #[allow(clippy::unnecessary_wraps)] // This is intentional.
#[inline]
fn compare_exchange_weak(
&self,
@@ -771,9 +936,6 @@
// TODO: AtomicU128 is unstable
// atomic!(@check, $t, atomic::AtomicU128, $a, $atomic_op);
- #[cfg(crossbeam_loom)]
- unimplemented!("loom does not support non-atomic atomic ops");
- #[cfg(not(crossbeam_loom))]
break $fallback_op;
}
};
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/src/atomic/mod.rs cargo-0.60.0ubuntu1/vendor/crossbeam-utils/src/atomic/mod.rs
--- cargo-0.58.0/vendor/crossbeam-utils/src/atomic/mod.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/src/atomic/mod.rs 2022-04-20 13:48:09.000000000 +0000
@@ -24,9 +24,14 @@
}
#[cfg(not(crossbeam_no_atomic_cas))]
+// We cannot provide AtomicCell under cfg(crossbeam_loom) because loom's atomic
+// types have a different in-memory representation than the underlying type.
+// TODO: The latest loom supports fences, so fallback using seqlock may be available.
+#[cfg(not(crossbeam_loom))]
mod atomic_cell;
mod consume;
#[cfg(not(crossbeam_no_atomic_cas))]
+#[cfg(not(crossbeam_loom))]
pub use self::atomic_cell::AtomicCell;
pub use self::consume::AtomicConsume;
diff -Nru cargo-0.58.0/vendor/crossbeam-utils/tests/atomic_cell.rs cargo-0.60.0ubuntu1/vendor/crossbeam-utils/tests/atomic_cell.rs
--- cargo-0.58.0/vendor/crossbeam-utils/tests/atomic_cell.rs 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/crossbeam-utils/tests/atomic_cell.rs 2022-04-20 13:48:09.000000000 +0000
@@ -265,6 +265,50 @@
assert_eq!(CELL.load(), 1);
}
+// https://github.com/crossbeam-rs/crossbeam/pull/767
+macro_rules! test_arithmetic {
+ ($test_name:ident, $ty:ident) => {
+ #[test]
+ fn $test_name() {
+ let a: AtomicCell<$ty> = AtomicCell::new(7);
+
+ assert_eq!(a.fetch_add(3), 7);
+ assert_eq!(a.load(), 10);
+
+ assert_eq!(a.fetch_sub(3), 10);
+ assert_eq!(a.load(), 7);
+
+ assert_eq!(a.fetch_and(3), 7);
+ assert_eq!(a.load(), 3);
+
+ assert_eq!(a.fetch_or(16), 3);
+ assert_eq!(a.load(), 19);
+
+ assert_eq!(a.fetch_xor(2), 19);
+ assert_eq!(a.load(), 17);
+
+ assert_eq!(a.fetch_max(18), 17);
+ assert_eq!(a.load(), 18);
+
+ assert_eq!(a.fetch_min(17), 18);
+ assert_eq!(a.load(), 17);
+
+ assert_eq!(a.fetch_nand(7), 17);
+ assert_eq!(a.load(), !(17 & 7));
+ }
+ };
+}
+test_arithmetic!(arithmetic_u8, u8);
+test_arithmetic!(arithmetic_i8, i8);
+test_arithmetic!(arithmetic_u16, u16);
+test_arithmetic!(arithmetic_i16, i16);
+test_arithmetic!(arithmetic_u32, u32);
+test_arithmetic!(arithmetic_i32, i32);
+test_arithmetic!(arithmetic_u64, u64);
+test_arithmetic!(arithmetic_i64, i64);
+test_arithmetic!(arithmetic_u128, u128);
+test_arithmetic!(arithmetic_i128, i128);
+
// https://github.com/crossbeam-rs/crossbeam/issues/748
#[cfg_attr(miri, ignore)] // TODO
#[rustversion::since(1.37)] // #[repr(align(N))] requires Rust 1.37
@@ -279,7 +323,10 @@
}
assert_eq!(mem::size_of::(), 8);
- assert!(AtomicCell::::is_lock_free());
+ assert_eq!(
+ AtomicCell::::is_lock_free(),
+ cfg!(not(crossbeam_no_atomic_64))
+ );
let x = AtomicCell::new(Test::FieldLess);
assert_eq!(x.load(), Test::FieldLess);
}
diff -Nru cargo-0.58.0/vendor/curl/build.rs cargo-0.60.0ubuntu1/vendor/curl/build.rs
--- cargo-0.58.0/vendor/curl/build.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/build.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,13 +1,12 @@
use std::env;
-use std::str::FromStr;
fn main() {
// OpenSSL >= 1.1.0 can be initialized concurrently and is initialized correctly by libcurl.
// <= 1.0.2 need locking callbacks, which are provided by openssl_sys::init().
- let use_openssl = match env::var("DEP_OPENSSL_VERSION") {
- Ok(ver) => {
- let ver = u32::from_str(&ver).unwrap();
- if ver < 110 {
+ let use_openssl = match env::var("DEP_OPENSSL_VERSION_NUMBER") {
+ Ok(version) => {
+ let version = u64::from_str_radix(&version, 16).unwrap();
+ if version < 0x1_01_00_00_0 {
println!("cargo:rustc-cfg=need_openssl_init");
}
true
diff -Nru cargo-0.58.0/vendor/curl/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/curl/.cargo-checksum.json
--- cargo-0.58.0/vendor/curl/.cargo-checksum.json 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"aaa3b8db7f3341ddef15786d250106334d4a6c4b0ae4a46cd77082777d9849b9"}
\ No newline at end of file
+{"files":{},"package":"37d855aeef205b43f65a5001e0997d81f8efca7badad4fad7d897aa7f0d0651f"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/curl/Cargo.lock cargo-0.60.0ubuntu1/vendor/curl/Cargo.lock
--- cargo-0.58.0/vendor/curl/Cargo.lock 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/Cargo.lock 2022-04-20 13:48:09.000000000 +0000
@@ -3,30 +3,10 @@
version = 3
[[package]]
-name = "aho-corasick"
-version = "0.7.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
-dependencies = [
- "memchr",
-]
-
-[[package]]
name = "anyhow"
-version = "1.0.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c0df63cb2955042487fad3aefd2c6e3ae7389ac5dc1beb28921de0b69f779d4"
-
-[[package]]
-name = "atty"
-version = "0.2.14"
+version = "1.0.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi",
- "libc",
- "winapi 0.3.9",
-]
+checksum = "84450d0b4a8bd1ba4144ce8ce718fbc5d071358b1e5384bace6536b3d1f2d5b3"
[[package]]
name = "autocfg"
@@ -36,36 +16,27 @@
[[package]]
name = "base64"
-version = "0.10.1"
+version = "0.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
-dependencies = [
- "byteorder",
-]
+checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
[[package]]
name = "bitflags"
-version = "1.2.1"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bumpalo"
-version = "3.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820"
-
-[[package]]
-name = "byteorder"
-version = "1.3.4"
+version = "3.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
+checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899"
[[package]]
name = "cc"
-version = "1.0.66"
+version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48"
+checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
[[package]]
name = "cfg-if"
@@ -80,26 +51,17 @@
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
name = "cmake"
-version = "0.1.45"
+version = "0.1.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855"
+checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a"
dependencies = [
"cc",
]
[[package]]
name = "curl"
-version = "0.4.39"
+version = "0.4.43"
dependencies = [
"anyhow",
"curl-sys",
@@ -115,45 +77,22 @@
[[package]]
name = "curl-sys"
-version = "0.4.49+curl-7.79.1"
+version = "0.4.53+curl-7.82.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0f44960aea24a786a46907b8824ebc0e66ca06bf4e4978408c7499620343483"
+checksum = "8092905a5a9502c312f223b2775f57ec5c5b715f9a15ee9d2a8591d1364a0352"
dependencies = [
"cc",
"libc",
"libnghttp2-sys",
"libz-sys",
- "mesalink",
"openssl-sys",
"pkg-config",
+ "rustls-ffi",
"vcpkg",
"winapi 0.3.9",
]
[[package]]
-name = "enum_to_u8_slice_derive"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8479a225129affae259452fd418b67af025ac86f60663a893baa407bc9897f43"
-dependencies = [
- "quote 0.3.15",
- "syn 0.11.11",
-]
-
-[[package]]
-name = "env_logger"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
-dependencies = [
- "atty",
- "humantime",
- "log",
- "regex",
- "termcolor",
-]
-
-[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -170,24 +109,6 @@
checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]]
-name = "hermit-abi"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "humantime"
-version = "1.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
-dependencies = [
- "quick-error",
-]
-
-[[package]]
name = "iovec"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -198,9 +119,9 @@
[[package]]
name = "js-sys"
-version = "0.3.46"
+version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175"
+checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
dependencies = [
"wasm-bindgen",
]
@@ -229,15 +150,15 @@
[[package]]
name = "libc"
-version = "0.2.92"
+version = "0.2.112"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714"
+checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125"
[[package]]
name = "libnghttp2-sys"
-version = "0.1.6+1.43.0"
+version = "0.1.7+1.45.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0af55541a8827e138d59ec9e5877fb6095ece63fb6f4da45e7491b4fbd262855"
+checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f"
dependencies = [
"cc",
"libc",
@@ -245,9 +166,9 @@
[[package]]
name = "libz-sys"
-version = "1.1.2"
+version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
+checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66"
dependencies = [
"cc",
"cmake",
@@ -257,55 +178,12 @@
]
[[package]]
-name = "lock_api"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
name = "log"
-version = "0.4.11"
+version = "0.4.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
- "cfg-if 0.1.10",
-]
-
-[[package]]
-name = "maybe-uninit"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
-
-[[package]]
-name = "memchr"
-version = "2.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
-
-[[package]]
-name = "mesalink"
-version = "1.1.0-cratesio"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05616fdd96cc48e233f660ce28e936950163b21f28bde25649acf55de411970a"
-dependencies = [
- "base64",
- "bitflags",
- "enum_to_u8_slice_derive",
- "env_logger",
- "lazy_static",
- "libc",
- "parking_lot",
- "ring",
- "rustls",
- "sct",
- "untrusted",
- "walkdir",
- "webpki",
- "webpki-roots",
+ "cfg-if 1.0.0",
]
[[package]]
@@ -353,9 +231,9 @@
[[package]]
name = "net2"
-version = "0.2.36"
+version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7cf75f38f16cb05ea017784dc6dbfd354f76c223dba37701734c4f5a9337d02"
+checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae"
dependencies = [
"cfg-if 0.1.10",
"libc",
@@ -363,31 +241,52 @@
]
[[package]]
+name = "num_enum"
+version = "0.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad"
+dependencies = [
+ "num_enum_derive",
+]
+
+[[package]]
+name = "num_enum_derive"
+version = "0.5.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21"
+dependencies = [
+ "proc-macro-crate",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "once_cell"
-version = "1.5.2"
+version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0"
+checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
[[package]]
name = "openssl-probe"
-version = "0.1.2"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
+checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
[[package]]
name = "openssl-src"
-version = "111.12.0+1.1.1h"
+version = "111.17.0+1.1.1m"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "858a4132194f8570a7ee9eb8629e85b23cbc4565f2d4a162e87556e5956abf61"
+checksum = "05d6a336abd10814198f66e2a91ccd7336611f30334119ca8ce300536666fcf4"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
-version = "0.9.58"
+version = "0.9.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de"
+checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb"
dependencies = [
"autocfg",
"cc",
@@ -398,96 +297,44 @@
]
[[package]]
-name = "parking_lot"
-version = "0.9.0"
+name = "pkg-config"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
-dependencies = [
- "lock_api",
- "parking_lot_core",
- "rustc_version",
-]
+checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
[[package]]
-name = "parking_lot_core"
-version = "0.6.2"
+name = "proc-macro-crate"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
+checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83"
dependencies = [
- "cfg-if 0.1.10",
- "cloudabi",
- "libc",
- "redox_syscall",
- "rustc_version",
- "smallvec",
- "winapi 0.3.9",
+ "thiserror",
+ "toml",
]
[[package]]
-name = "pkg-config"
-version = "0.3.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
-
-[[package]]
name = "proc-macro2"
-version = "1.0.24"
+version = "1.0.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71"
+checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
dependencies = [
- "unicode-xid 0.2.1",
+ "unicode-xid",
]
[[package]]
-name = "quick-error"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
-
-[[package]]
name = "quote"
-version = "0.3.15"
+version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
-
-[[package]]
-name = "quote"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
+checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d"
dependencies = [
"proc-macro2",
]
[[package]]
-name = "redox_syscall"
-version = "0.1.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
-
-[[package]]
-name = "regex"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
- "thread_local",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
-
-[[package]]
name = "ring"
-version = "0.16.19"
+version = "0.16.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "024a1e66fea74c66c66624ee5622a7ff0e4b73a13b4f5c326ddb50c708944226"
+checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc"
dependencies = [
"cc",
"libc",
@@ -499,34 +346,39 @@
]
[[package]]
-name = "rustc_version"
-version = "0.2.3"
+name = "rustls"
+version = "0.20.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
+checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84"
dependencies = [
- "semver",
+ "log",
+ "ring",
+ "sct",
+ "webpki",
]
[[package]]
-name = "rustls"
-version = "0.16.0"
+name = "rustls-ffi"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e"
+checksum = "9da52707cca59e6eef8a78f3ad8d04024254a168ed1b41eb4dfa9616eace781a"
dependencies = [
- "base64",
+ "libc",
"log",
- "ring",
+ "num_enum",
+ "rustls",
+ "rustls-pemfile",
"sct",
"webpki",
]
[[package]]
-name = "same-file"
-version = "1.0.6"
+name = "rustls-pemfile"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9"
dependencies = [
- "winapi-util",
+ "base64",
]
[[package]]
@@ -540,56 +392,32 @@
]
[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
name = "sct"
-version = "0.6.0"
+version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c"
+checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4"
dependencies = [
"ring",
"untrusted",
]
[[package]]
-name = "semver"
-version = "0.9.0"
+name = "serde"
+version = "1.0.133"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
-dependencies = [
- "semver-parser",
-]
-
-[[package]]
-name = "semver-parser"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
+checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
[[package]]
name = "slab"
-version = "0.4.2"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
-
-[[package]]
-name = "smallvec"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
-dependencies = [
- "maybe-uninit",
-]
+checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5"
[[package]]
name = "socket2"
-version = "0.4.0"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2"
+checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516"
dependencies = [
"libc",
"winapi 0.3.9",
@@ -603,64 +431,49 @@
[[package]]
name = "syn"
-version = "0.11.11"
+version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
-dependencies = [
- "quote 0.3.15",
- "synom",
- "unicode-xid 0.0.4",
-]
-
-[[package]]
-name = "syn"
-version = "1.0.54"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44"
+checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7"
dependencies = [
"proc-macro2",
- "quote 1.0.7",
- "unicode-xid 0.2.1",
+ "quote",
+ "unicode-xid",
]
[[package]]
-name = "synom"
-version = "0.11.3"
+name = "thiserror"
+version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
+checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
dependencies = [
- "unicode-xid 0.0.4",
+ "thiserror-impl",
]
[[package]]
-name = "termcolor"
-version = "1.1.2"
+name = "thiserror-impl"
+version = "1.0.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
+checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
dependencies = [
- "winapi-util",
+ "proc-macro2",
+ "quote",
+ "syn",
]
[[package]]
-name = "thread_local"
-version = "1.0.1"
+name = "toml"
+version = "0.5.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
+checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
dependencies = [
- "lazy_static",
+ "serde",
]
[[package]]
name = "unicode-xid"
-version = "0.0.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.1"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "untrusted"
@@ -670,26 +483,15 @@
[[package]]
name = "vcpkg"
-version = "0.2.10"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
-
-[[package]]
-name = "walkdir"
-version = "2.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
-dependencies = [
- "same-file",
- "winapi 0.3.9",
- "winapi-util",
-]
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "wasm-bindgen"
-version = "0.2.69"
+version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e"
+checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
dependencies = [
"cfg-if 1.0.0",
"wasm-bindgen-macro",
@@ -697,53 +499,53 @@
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.69"
+version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62"
+checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
dependencies = [
"bumpalo",
"lazy_static",
"log",
"proc-macro2",
- "quote 1.0.7",
- "syn 1.0.54",
+ "quote",
+ "syn",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.69"
+version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084"
+checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
dependencies = [
- "quote 1.0.7",
+ "quote",
"wasm-bindgen-macro-support",
]
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.69"
+version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549"
+checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
dependencies = [
"proc-macro2",
- "quote 1.0.7",
- "syn 1.0.54",
+ "quote",
+ "syn",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.69"
+version = "0.2.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158"
+checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
[[package]]
name = "web-sys"
-version = "0.3.46"
+version = "0.3.55"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3"
+checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb"
dependencies = [
"js-sys",
"wasm-bindgen",
@@ -751,24 +553,15 @@
[[package]]
name = "webpki"
-version = "0.21.4"
+version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea"
+checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd"
dependencies = [
"ring",
"untrusted",
]
[[package]]
-name = "webpki-roots"
-version = "0.17.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a262ae37dd9d60f60dd473d1158f9fbebf110ba7b6a5051c8160460f6043718b"
-dependencies = [
- "webpki",
-]
-
-[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -797,15 +590,6 @@
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi 0.3.9",
-]
-
-[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
diff -Nru cargo-0.58.0/vendor/curl/Cargo.toml cargo-0.60.0ubuntu1/vendor/curl/Cargo.toml
--- cargo-0.58.0/vendor/curl/Cargo.toml 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "curl"
-version = "0.4.39"
+version = "0.4.43"
authors = ["Alex Crichton "]
autotests = true
description = "Rust bindings to libcurl for making HTTP requests"
@@ -24,6 +24,10 @@
repository = "https://github.com/alexcrichton/curl-rust"
[[example]]
+name = "https"
+path = "examples/https.rs"
+
+[[example]]
name = "ssl_proxy"
path = "examples/ssl_proxy.rs"
required-features = ["ssl"]
@@ -38,11 +42,16 @@
path = "examples/aws_sigv4.rs"
required-features = ["static-curl", "ssl"]
+[[example]]
+name = "multi-dl"
+path = "examples/multi-dl.rs"
+required-features = ["ssl"]
+
[[test]]
name = "atexit"
harness = false
[dependencies.curl-sys]
-version = "0.4.49"
+version = "0.4.53"
default-features = false
[dependencies.libc]
@@ -63,6 +72,7 @@
default = ["ssl"]
force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"]
http2 = ["curl-sys/http2"]
+rustls = ["curl-sys/rustls"]
ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"]
static-curl = ["curl-sys/static-curl"]
static-ssl = ["curl-sys/static-ssl"]
diff -Nru cargo-0.58.0/vendor/curl/ci/run.sh cargo-0.60.0ubuntu1/vendor/curl/ci/run.sh
--- cargo-0.58.0/vendor/curl/ci/run.sh 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/ci/run.sh 2022-04-20 13:48:09.000000000 +0000
@@ -5,8 +5,10 @@
cargo test --target $TARGET --no-run
# First test with no extra protocols enabled.
cargo test --target $TARGET --no-run --features static-curl
+# Then with rustls TLS backend.
+cargo test --target $TARGET --no-run --features rustls,static-curl
# Then with all extra protocols enabled.
-cargo test --target $TARGET --no-run --features static-curl,protocol-ftp
+cargo test --target $TARGET --no-run --features static-curl,protocol-ftp,ntlm
if [ -z "$NO_RUN" ]; then
cargo test --target $TARGET
cargo test --target $TARGET --features static-curl
diff -Nru cargo-0.58.0/vendor/curl/debian/patches/disable-features.patch cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-features.patch
--- cargo-0.58.0/vendor/curl/debian/patches/disable-features.patch 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-features.patch 2022-04-20 13:48:09.000000000 +0000
@@ -2,11 +2,14 @@
--- a/Cargo.toml
+++ b/Cargo.toml
-@@ -63,13 +63,9 @@
+@@ -63,16 +63,10 @@
default = ["ssl"]
force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"]
http2 = ["curl-sys/http2"]
+-ntlm = ["curl-sys/ntlm"]
+-poll_7_68_0 = ["curl-sys/poll_7_68_0"]
-protocol-ftp = ["curl-sys/protocol-ftp"]
+ rustls = ["curl-sys/rustls"]
-spnego = ["curl-sys/spnego"]
ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"]
static-curl = ["curl-sys/static-curl"]
diff -Nru cargo-0.58.0/vendor/curl/debian/patches/disable-features.patch.orig cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-features.patch.orig
--- cargo-0.58.0/vendor/curl/debian/patches/disable-features.patch.orig 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-features.patch.orig 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,18 @@
+Description: for now, disable some features to avoid NEW trip
+
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -63,13 +63,9 @@
+ default = ["ssl"]
+ force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"]
+ http2 = ["curl-sys/http2"]
+-protocol-ftp = ["curl-sys/protocol-ftp"]
+-spnego = ["curl-sys/spnego"]
+ ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"]
+ static-curl = ["curl-sys/static-curl"]
+ static-ssl = ["curl-sys/static-ssl"]
+-upkeep_7_62_0 = ["curl-sys/upkeep_7_62_0"]
+-zlib-ng-compat = ["curl-sys/zlib-ng-compat", "static-curl"]
+ [target."cfg(all(unix, not(target_os = \"macos\")))".dependencies.openssl-probe]
+ version = "0.1.2"
+ optional = true
diff -Nru cargo-0.58.0/vendor/curl/debian/patches/disable-mesalink.patch cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-mesalink.patch
--- cargo-0.58.0/vendor/curl/debian/patches/disable-mesalink.patch 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-mesalink.patch 2022-04-20 13:48:09.000000000 +0000
@@ -6,6 +6,6 @@
force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"]
http2 = ["curl-sys/http2"]
-mesalink = ["curl-sys/mesalink"]
+ ntlm = ["curl-sys/ntlm"]
+ poll_7_68_0 = ["curl-sys/poll_7_68_0"]
protocol-ftp = ["curl-sys/protocol-ftp"]
- spnego = ["curl-sys/spnego"]
- ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"]
diff -Nru cargo-0.58.0/vendor/curl/debian/patches/disable-mesalink.patch.orig cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-mesalink.patch.orig
--- cargo-0.58.0/vendor/curl/debian/patches/disable-mesalink.patch.orig 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/debian/patches/disable-mesalink.patch.orig 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,11 @@
+Description: for now, disable mesalink as it has some extra deps
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -44,7 +44,6 @@
+ default = ["ssl"]
+ force-system-lib-on-osx = ["curl-sys/force-system-lib-on-osx"]
+ http2 = ["curl-sys/http2"]
+-mesalink = ["curl-sys/mesalink"]
+ protocol-ftp = ["curl-sys/protocol-ftp"]
+ spnego = ["curl-sys/spnego"]
+ ssl = ["openssl-sys", "openssl-probe", "curl-sys/ssl"]
diff -Nru cargo-0.58.0/vendor/curl/examples/doh.rs cargo-0.60.0ubuntu1/vendor/curl/examples/doh.rs
--- cargo-0.58.0/vendor/curl/examples/doh.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/examples/doh.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,17 @@
+use curl::easy::Easy;
+use std::io::{stdout, Write};
+
+fn main() -> Result<(), curl::Error> {
+ let mut curl = Easy::new();
+
+ curl.url("https://example.com")?;
+ curl.doh_url(Some("https://cloudflare-dns.com/dns-query"))?;
+ curl.write_function(|data| {
+ stdout().write_all(data).unwrap();
+ Ok(data.len())
+ })?;
+
+ curl.perform()?;
+
+ Ok(())
+}
diff -Nru cargo-0.58.0/vendor/curl/examples/https.rs cargo-0.60.0ubuntu1/vendor/curl/examples/https.rs
--- cargo-0.58.0/vendor/curl/examples/https.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/examples/https.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,23 @@
+//! Simple HTTPS GET
+//!
+//! This example is a Rust adaptation of the [C example of the same
+//! name](https://curl.se/libcurl/c/https.html).
+
+extern crate curl;
+
+use curl::easy::Easy;
+use std::io::{stdout, Write};
+
+fn main() -> Result<(), curl::Error> {
+ let mut curl = Easy::new();
+
+ curl.url("https://example.com/")?;
+ curl.write_function(|data| {
+ stdout().write_all(data).unwrap();
+ Ok(data.len())
+ })?;
+
+ curl.perform()?;
+
+ Ok(())
+}
diff -Nru cargo-0.58.0/vendor/curl/examples/multi-dl.rs cargo-0.60.0ubuntu1/vendor/curl/examples/multi-dl.rs
--- cargo-0.58.0/vendor/curl/examples/multi-dl.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/examples/multi-dl.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,88 @@
+use std::collections::HashMap;
+use std::time::Duration;
+
+use anyhow::Result;
+
+use curl::easy::{Easy2, Handler, WriteError};
+use curl::multi::{Easy2Handle, Multi};
+
+const URLS: &[&str] = &[
+ "https://www.microsoft.com",
+ "https://www.google.com",
+ "https://www.amazon.com",
+ "https://www.apple.com",
+];
+
+struct Collector(Vec);
+impl Handler for Collector {
+ fn write(&mut self, data: &[u8]) -> Result {
+ self.0.extend_from_slice(data);
+ Ok(data.len())
+ }
+}
+
+fn download(multi: &mut Multi, token: usize, url: &str) -> Result> {
+ let version = curl::Version::get();
+ let mut request = Easy2::new(Collector(Vec::new()));
+ request.url(&url)?;
+ request.useragent(&format!("curl/{}", version.version()))?;
+
+ let mut handle = multi.add2(request)?;
+ handle.set_token(token)?;
+ Ok(handle)
+}
+
+fn main() -> Result<()> {
+ let mut multi = Multi::new();
+ let mut handles = URLS
+ .iter()
+ .enumerate()
+ .map(|(token, url)| Ok((token, download(&mut multi, token, url)?)))
+ .collect::>>()?;
+
+ let mut still_alive = true;
+ while still_alive {
+ // We still need to process the last messages when
+ // `Multi::perform` returns "0".
+ if multi.perform()? == 0 {
+ still_alive = false;
+ }
+
+ multi.messages(|message| {
+ let token = message.token().expect("failed to get the token");
+ let handle = handles
+ .get_mut(&token)
+ .expect("the download value should exist in the HashMap");
+
+ match message
+ .result_for2(&handle)
+ .expect("token mismatch with the `EasyHandle`")
+ {
+ Ok(()) => {
+ let http_status = handle
+ .response_code()
+ .expect("HTTP request finished without status code");
+
+ println!(
+ "R: Transfer succeeded (Status: {}) {} (Download length: {})",
+ http_status,
+ URLS[token],
+ handle.get_ref().0.len()
+ );
+ }
+ Err(error) => {
+ println!("E: {} - <{}>", error, URLS[token]);
+ }
+ }
+ });
+
+ if still_alive {
+ // The sleeping time could be reduced to allow other processing.
+ // For instance, a thread could check a condition signalling the
+ // thread shutdown.
+ multi.wait(&mut [], Duration::from_secs(60))?;
+ }
+ }
+
+ Ok(())
+}
diff -Nru cargo-0.58.0/vendor/curl/examples/ssl_proxy.rs cargo-0.60.0ubuntu1/vendor/curl/examples/ssl_proxy.rs
--- cargo-0.58.0/vendor/curl/examples/ssl_proxy.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/examples/ssl_proxy.rs 2022-04-20 13:48:09.000000000 +0000
@@ -16,9 +16,9 @@
handle.proxy(proxy_url)?;
handle.proxy_port(proxy_port)?;
- handle.proxy_cainfo(&cainfo)?;
- handle.proxy_sslcert(&sslcert)?;
- handle.proxy_sslkey(&sslkey)?;
+ handle.proxy_cainfo(cainfo)?;
+ handle.proxy_sslcert(sslcert)?;
+ handle.proxy_sslkey(sslkey)?;
println!("ssl proxy setup done");
handle.perform()?;
diff -Nru cargo-0.58.0/vendor/curl/README.md cargo-0.60.0ubuntu1/vendor/curl/README.md
--- cargo-0.58.0/vendor/curl/README.md 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/README.md 2022-04-20 13:48:09.000000000 +0000
@@ -123,12 +123,16 @@
with various Cargo features:
- `ssl`: Enable SSL/TLS support using the platform-default TLS backend. On Windows this is [Schannel], on macOS [Secure Transport], and [OpenSSL] (or equivalent) on all other platforms. Enabled by default.
-- `mesalink`: Enable SSL/TLS support via [MesaLink], an alternative TLS backend written in Rust based on [Rustls]. MesaLink is always statically linked. Disabled by default.
+- `rustls` Enable SSL/TLS support via [Rustls], a well-received alternative TLS backend written in Rust. Rustls is always statically linked. Disabled by default.
+
+ Note that Rustls support is experimental within Curl itself and may have significant bugs, so we don't offer any sort of stability guarantee with this feature.
- `http2`: Enable HTTP/2 support via libnghttp2. Disabled by default.
- `static-curl`: Use a bundled libcurl version and statically link to it. Disabled by default.
- `static-ssl`: Use a bundled OpenSSL version and statically link to it. Only applies on platforms that use OpenSSL. Disabled by default.
- `spnego`: Enable SPNEGO support. Disabled by default.
- `upkeep_7_62_0`: Enable curl_easy_upkeep() support, introduced in curl 7.62.0. Disabled by default.
+- `poll_7_68_0`: Enable curl_multi_poll()/curl_multi_wakeup() support, requires curl 7.68.0 or later. Disabled by default.
+- `ntlm`: Enable NTLM support in curl. Disabled by default.
## Version Support
@@ -164,7 +168,6 @@
[libcurl]: https://curl.haxx.se/libcurl/
-[MesaLink]: https://mesalink.io/
[OpenSSL]: https://www.openssl.org/
[Rustls]: https://github.com/ctz/rustls
[Schannel]: https://docs.microsoft.com/en-us/windows/win32/com/schannel
diff -Nru cargo-0.58.0/vendor/curl/src/easy/handler.rs cargo-0.60.0ubuntu1/vendor/curl/src/easy/handler.rs
--- cargo-0.58.0/vendor/curl/src/easy/handler.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/src/easy/handler.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1049,6 +1049,123 @@
self.setopt_long(curl_sys::CURLOPT_DNS_CACHE_TIMEOUT, dur.as_secs() as c_long)
}
+ /// Provide the DNS-over-HTTPS URL.
+ ///
+ /// The parameter must be URL-encoded in the following format:
+ /// `https://host:port/path`. It **must** specify a HTTPS URL.
+ ///
+ /// libcurl does not validate the syntax or use this variable until the
+ /// transfer is issued. Even if you set a crazy value here, this method will
+ /// still return [`Ok`].
+ ///
+ /// curl sends `POST` requests to the given DNS-over-HTTPS URL.
+ ///
+ /// To find the DoH server itself, which might be specified using a name,
+ /// libcurl will use the default name lookup function. You can bootstrap
+ /// that by providing the address for the DoH server with
+ /// [`Easy2::resolve`].
+ ///
+ /// Disable DoH use again by setting this option to [`None`].
+ ///
+ /// By default this option is not set and corresponds to `CURLOPT_DOH_URL`.
+ pub fn doh_url(&mut self, url: Option<&str>) -> Result<(), Error> {
+ if let Some(url) = url {
+ let url = CString::new(url)?;
+ self.setopt_str(curl_sys::CURLOPT_DOH_URL, &url)
+ } else {
+ self.setopt_ptr(curl_sys::CURLOPT_DOH_URL, ptr::null())
+ }
+ }
+
+ /// This option tells curl to verify the authenticity of the DoH
+ /// (DNS-over-HTTPS) server's certificate. A value of `true` means curl
+ /// verifies; `false` means it does not.
+ ///
+ /// This option is the DoH equivalent of [`Easy2::ssl_verify_peer`] and only
+ /// affects requests to the DoH server.
+ ///
+ /// When negotiating a TLS or SSL connection, the server sends a certificate
+ /// indicating its identity. Curl verifies whether the certificate is
+ /// authentic, i.e. that you can trust that the server is who the
+ /// certificate says it is. This trust is based on a chain of digital
+ /// signatures, rooted in certification authority (CA) certificates you
+ /// supply. curl uses a default bundle of CA certificates (the path for that
+ /// is determined at build time) and you can specify alternate certificates
+ /// with the [`Easy2::cainfo`] option or the [`Easy2::capath`] option.
+ ///
+ /// When `doh_ssl_verify_peer` is enabled, and the verification fails to
+ /// prove that the certificate is authentic, the connection fails. When the
+ /// option is zero, the peer certificate verification succeeds regardless.
+ ///
+ /// Authenticating the certificate is not enough to be sure about the
+ /// server. You typically also want to ensure that the server is the server
+ /// you mean to be talking to. Use [`Easy2::doh_ssl_verify_host`] for that.
+ /// The check that the host name in the certificate is valid for the host
+ /// name you are connecting to is done independently of the
+ /// `doh_ssl_verify_peer` option.
+ ///
+ /// **WARNING:** disabling verification of the certificate allows bad guys
+ /// to man-in-the-middle the communication without you knowing it. Disabling
+ /// verification makes the communication insecure. Just having encryption on
+ /// a transfer is not enough as you cannot be sure that you are
+ /// communicating with the correct end-point.
+ ///
+ /// By default this option is set to `true` and corresponds to
+ /// `CURLOPT_DOH_SSL_VERIFYPEER`.
+ pub fn doh_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+ self.setopt_long(curl_sys::CURLOPT_DOH_SSL_VERIFYPEER, verify.into())
+ }
+
+ /// Tells curl to verify the DoH (DNS-over-HTTPS) server's certificate name
+ /// fields against the host name.
+ ///
+ /// This option is the DoH equivalent of [`Easy2::ssl_verify_host`] and only
+ /// affects requests to the DoH server.
+ ///
+ /// When `doh_ssl_verify_host` is `true`, the SSL certificate provided by
+ /// the DoH server must indicate that the server name is the same as the
+ /// server name to which you meant to connect to, or the connection fails.
+ ///
+ /// Curl considers the DoH server the intended one when the Common Name
+ /// field or a Subject Alternate Name field in the certificate matches the
+ /// host name in the DoH URL to which you told Curl to connect.
+ ///
+ /// When the verify value is set to `false`, the connection succeeds
+ /// regardless of the names used in the certificate. Use that ability with
+ /// caution!
+ ///
+ /// See also [`Easy2::doh_ssl_verify_peer`] to verify the digital signature
+ /// of the DoH server certificate. If libcurl is built against NSS and
+ /// [`Easy2::doh_ssl_verify_peer`] is `false`, `doh_ssl_verify_host` is also
+ /// set to `false` and cannot be overridden.
+ ///
+ /// By default this option is set to `true` and corresponds to
+ /// `CURLOPT_DOH_SSL_VERIFYHOST`.
+ pub fn doh_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+ self.setopt_long(
+ curl_sys::CURLOPT_DOH_SSL_VERIFYHOST,
+ if verify { 2 } else { 0 },
+ )
+ }
+
+ /// Pass a long as parameter set to 1 to enable or 0 to disable.
+ ///
+ /// This option determines whether libcurl verifies the status of the DoH
+ /// (DNS-over-HTTPS) server cert using the "Certificate Status Request" TLS
+ /// extension (aka. OCSP stapling).
+ ///
+ /// This option is the DoH equivalent of CURLOPT_SSL_VERIFYSTATUS and only
+ /// affects requests to the DoH server.
+ ///
+ /// Note that if this option is enabled but the server does not support the
+ /// TLS extension, the verification will fail.
+ ///
+ /// By default this option is set to `false` and corresponds to
+ /// `CURLOPT_DOH_SSL_VERIFYSTATUS`.
+ pub fn doh_ssl_verify_status(&mut self, verify: bool) -> Result<(), Error> {
+ self.setopt_long(curl_sys::CURLOPT_DOH_SSL_VERIFYSTATUS, verify.into())
+ }
+
/// Specify the preferred receive buffer size, in bytes.
///
/// This is treated as a request, not an order, and the main point of this
@@ -1343,7 +1460,7 @@
/// `CURLOPT_POSTFIELDSIZE_LARGE`.
pub fn post_field_size(&mut self, size: u64) -> Result<(), Error> {
// Clear anything previous to ensure we don't read past a buffer
- self.setopt_ptr(curl_sys::CURLOPT_POSTFIELDS, 0 as *const _)?;
+ self.setopt_ptr(curl_sys::CURLOPT_POSTFIELDS, ptr::null())?;
self.setopt_off_t(
curl_sys::CURLOPT_POSTFIELDSIZE_LARGE,
size as curl_sys::curl_off_t,
@@ -1738,7 +1855,7 @@
pub fn timeout(&mut self, timeout: Duration) -> Result<(), Error> {
// TODO: checked arithmetic and casts
// TODO: use CURLOPT_TIMEOUT if the timeout is too great
- let ms = timeout.as_secs() * 1000 + (timeout.subsec_nanos() / 1_000_000) as u64;
+ let ms = timeout.as_secs() * 1000 + timeout.subsec_millis() as u64;
self.setopt_long(curl_sys::CURLOPT_TIMEOUT_MS, ms as c_long)
}
@@ -1860,7 +1977,7 @@
/// By default this value is 300 seconds and corresponds to
/// `CURLOPT_CONNECTTIMEOUT_MS`.
pub fn connect_timeout(&mut self, timeout: Duration) -> Result<(), Error> {
- let ms = timeout.as_secs() * 1000 + (timeout.subsec_nanos() / 1_000_000) as u64;
+ let ms = timeout.as_secs() * 1000 + timeout.subsec_millis() as u64;
self.setopt_long(curl_sys::CURLOPT_CONNECTTIMEOUT_MS, ms as c_long)
}
@@ -2073,6 +2190,18 @@
self.setopt_str(curl_sys::CURLOPT_KEYPASSWD, &password)
}
+ /// Set the SSL Certificate Authorities using an in-memory blob.
+ ///
+ /// The specified byte buffer should contain the binary content of one
+ /// or more PEM-encoded CA certificates, which will be copied into
+ /// the handle.
+ ///
+ /// By default this option is not set and corresponds to
+ /// `CURLOPT_CAINFO_BLOB`.
+ pub fn ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+ self.setopt_blob(curl_sys::CURLOPT_CAINFO_BLOB, blob)
+ }
+
/// Set the SSL engine identifier.
///
/// This will be used as the identifier for the crypto engine you want to
@@ -2411,7 +2540,7 @@
/// By default this option is not set and corresponds to
/// `CURLOPT_EXPECT_100_TIMEOUT_MS`.
pub fn expect_100_timeout(&mut self, timeout: Duration) -> Result<(), Error> {
- let ms = timeout.as_secs() * 1000 + (timeout.subsec_nanos() / 1_000_000) as u64;
+ let ms = timeout.as_secs() * 1000 + timeout.subsec_millis() as u64;
self.setopt_long(curl_sys::CURLOPT_EXPECT_100_TIMEOUT_MS, ms as c_long)
}
@@ -2422,15 +2551,8 @@
//// This corresponds to `CURLINFO_CONDITION_UNMET` and may return an error if the
/// option is not supported
pub fn time_condition_unmet(&mut self) -> Result {
- self.getopt_long(curl_sys::CURLINFO_CONDITION_UNMET).map(
- |r| {
- if r == 0 {
- false
- } else {
- true
- }
- },
- )
+ self.getopt_long(curl_sys::CURLINFO_CONDITION_UNMET)
+ .map(|r| r != 0)
}
/// Get the last used URL
@@ -2894,7 +3016,7 @@
/// URL encodes a string `s`
pub fn url_encode(&mut self, s: &[u8]) -> String {
- if s.len() == 0 {
+ if s.is_empty() {
return String::new();
}
unsafe {
@@ -2913,7 +3035,7 @@
/// URL decodes a string `s`, returning `None` if it fails
pub fn url_decode(&mut self, s: &str) -> Vec {
- if s.len() == 0 {
+ if s.is_empty() {
return Vec::new();
}
@@ -3078,7 +3200,7 @@
fn getopt_ptr(&mut self, opt: curl_sys::CURLINFO) -> Result<*const c_char, Error> {
unsafe {
- let mut p = 0 as *const c_char;
+ let mut p = ptr::null();
let rc = curl_sys::curl_easy_getinfo(self.inner.handle, opt, &mut p);
self.cvt(rc)?;
Ok(p)
diff -Nru cargo-0.58.0/vendor/curl/src/easy/handle.rs cargo-0.60.0ubuntu1/vendor/curl/src/easy/handle.rs
--- cargo-0.58.0/vendor/curl/src/easy/handle.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/src/easy/handle.rs 2022-04-20 13:48:09.000000000 +0000
@@ -648,6 +648,26 @@
self.inner.dns_cache_timeout(dur)
}
+ /// Same as [`Easy2::doh_url`](struct.Easy2.html#method.doh_url)
+ pub fn doh_url(&mut self, url: Option<&str>) -> Result<(), Error> {
+ self.inner.doh_url(url)
+ }
+
+ /// Same as [`Easy2::doh_ssl_verify_peer`](struct.Easy2.html#method.doh_ssl_verify_peer)
+ pub fn doh_ssl_verify_peer(&mut self, verify: bool) -> Result<(), Error> {
+ self.inner.doh_ssl_verify_peer(verify)
+ }
+
+ /// Same as [`Easy2::doh_ssl_verify_host`](struct.Easy2.html#method.doh_ssl_verify_host)
+ pub fn doh_ssl_verify_host(&mut self, verify: bool) -> Result<(), Error> {
+ self.inner.doh_ssl_verify_host(verify)
+ }
+
+ /// Same as [`Easy2::doh_ssl_verify_status`](struct.Easy2.html#method.doh_ssl_verify_status)
+ pub fn doh_ssl_verify_status(&mut self, verify: bool) -> Result<(), Error> {
+ self.inner.doh_ssl_verify_status(verify)
+ }
+
/// Same as [`Easy2::buffer_size`](struct.Easy2.html#method.buffer_size)
pub fn buffer_size(&mut self, size: usize) -> Result<(), Error> {
self.inner.buffer_size(size)
@@ -1003,6 +1023,11 @@
self.inner.key_password(password)
}
+ /// Same as [`Easy2::ssl_cainfo_blob`](struct.Easy2.html#method.ssl_cainfo_blob)
+ pub fn ssl_cainfo_blob(&mut self, blob: &[u8]) -> Result<(), Error> {
+ self.inner.ssl_cainfo_blob(blob)
+ }
+
/// Same as [`Easy2::ssl_engine`](struct.Easy2.html#method.ssl_engine)
pub fn ssl_engine(&mut self, engine: &str) -> Result<(), Error> {
self.inner.ssl_engine(engine)
diff -Nru cargo-0.58.0/vendor/curl/src/error.rs cargo-0.60.0ubuntu1/vendor/curl/src/error.rs
--- cargo-0.58.0/vendor/curl/src/error.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/src/error.rs 2022-04-20 13:48:09.000000000 +0000
@@ -4,8 +4,6 @@
use std::io;
use std::str;
-use curl_sys;
-
/// An error returned from various "easy" operations.
///
/// This structure wraps a `CURLcode`.
diff -Nru cargo-0.58.0/vendor/curl/src/lib.rs cargo-0.60.0ubuntu1/vendor/curl/src/lib.rs
--- cargo-0.58.0/vendor/curl/src/lib.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/src/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -70,6 +70,9 @@
pub mod multi;
mod panic;
+#[cfg(test)]
+static INITIALIZED: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+
/// Initializes the underlying libcurl library.
///
/// The underlying libcurl library must be initialized before use, and must be
@@ -90,46 +93,62 @@
/// Used to prevent concurrent or duplicate initialization.
static INIT: Once = Once::new();
- /// An exported constructor function. On supported platforms, this will be
- /// invoked automatically before the program's `main` is called.
- #[cfg_attr(
- any(target_os = "linux", target_os = "freebsd", target_os = "android"),
- link_section = ".init_array"
- )]
- #[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")]
- #[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")]
- static INIT_CTOR: extern "C" fn() = init_inner;
+ INIT.call_once(|| {
+ #[cfg(need_openssl_init)]
+ openssl_probe::init_ssl_cert_env_vars();
+ #[cfg(need_openssl_init)]
+ openssl_sys::init();
+
+ unsafe {
+ assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
+ }
+
+ #[cfg(test)]
+ {
+ INITIALIZED.store(true, std::sync::atomic::Ordering::SeqCst);
+ }
+
+ // Note that we explicitly don't schedule a call to
+ // `curl_global_cleanup`. The documentation for that function says
+ //
+ // > You must not call it when any other thread in the program (i.e. a
+ // > thread sharing the same memory) is running. This doesn't just mean
+ // > no other thread that is using libcurl.
+ //
+ // We can't ever be sure of that, so unfortunately we can't call the
+ // function.
+ });
+}
+/// An exported constructor function. On supported platforms, this will be
+/// invoked automatically before the program's `main` is called. This is done
+/// for the convenience of library users since otherwise the thread-safety rules
+/// around initialization can be difficult to fulfill.
+///
+/// This is a hidden public item to ensure the symbol isn't optimized away by a
+/// rustc/LLVM bug: https://github.com/rust-lang/rust/issues/47384. As long as
+/// any item in this module is used by the final binary (which `init` will be)
+/// then this symbol should be preserved.
+#[used]
+#[doc(hidden)]
+#[cfg_attr(
+ any(target_os = "linux", target_os = "freebsd", target_os = "android"),
+ link_section = ".init_array"
+)]
+#[cfg_attr(target_os = "macos", link_section = "__DATA,__mod_init_func")]
+#[cfg_attr(target_os = "windows", link_section = ".CRT$XCU")]
+pub static INIT_CTOR: extern "C" fn() = {
/// This is the body of our constructor function.
#[cfg_attr(
any(target_os = "linux", target_os = "android"),
link_section = ".text.startup"
)]
- extern "C" fn init_inner() {
- INIT.call_once(|| {
- #[cfg(need_openssl_init)]
- openssl_sys::init();
-
- unsafe {
- assert_eq!(curl_sys::curl_global_init(curl_sys::CURL_GLOBAL_ALL), 0);
- }
-
- // Note that we explicitly don't schedule a call to
- // `curl_global_cleanup`. The documentation for that function says
- //
- // > You must not call it when any other thread in the program (i.e.
- // > a thread sharing the same memory) is running. This doesn't just
- // > mean no other thread that is using libcurl.
- //
- // We can't ever be sure of that, so unfortunately we can't call the
- // function.
- });
+ extern "C" fn init_ctor() {
+ init();
}
- // We invoke our init function through our static to ensure the symbol isn't
- // optimized away by a bug: https://github.com/rust-lang/rust/issues/47384
- INIT_CTOR();
-}
+ init_ctor
+};
unsafe fn opt_str<'a>(ptr: *const libc::c_char) -> Option<&'a str> {
if ptr.is_null() {
@@ -146,3 +165,20 @@
Err(Error::new(r))
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ #[cfg(any(
+ target_os = "linux",
+ target_os = "macos",
+ target_os = "windows",
+ target_os = "freebsd",
+ target_os = "android"
+ ))]
+ fn is_initialized_before_main() {
+ assert!(INITIALIZED.load(std::sync::atomic::Ordering::SeqCst));
+ }
+}
diff -Nru cargo-0.58.0/vendor/curl/src/multi.rs cargo-0.60.0ubuntu1/vendor/curl/src/multi.rs
--- cargo-0.58.0/vendor/curl/src/multi.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/src/multi.rs 2022-04-20 13:48:09.000000000 +0000
@@ -3,6 +3,7 @@
use std::fmt;
use std::marker;
use std::ptr;
+use std::sync::Arc;
use std::time::Duration;
use curl_sys;
@@ -29,10 +30,15 @@
///
/// [multi tutorial]: https://curl.haxx.se/libcurl/c/libcurl-multi.html
pub struct Multi {
- raw: *mut curl_sys::CURLM,
+ raw: Arc,
data: Box,
}
+#[derive(Debug)]
+struct RawMulti {
+ handle: *mut curl_sys::CURLM,
+}
+
struct MultiData {
socket: Box,
timer: Box) -> bool + Send>,
@@ -52,6 +58,8 @@
/// be used via `perform`. This handle is also used to remove the easy handle
/// from the multi handle when desired.
pub struct EasyHandle {
+ // Safety: This *must* be before `easy` as it must be dropped first.
+ guard: DetachGuard,
easy: Easy,
// This is now effectively bound to a `Multi`, so it is no longer sendable.
_marker: marker::PhantomData<&'static Multi>,
@@ -63,11 +71,20 @@
/// be used via `perform`. This handle is also used to remove the easy handle
/// from the multi handle when desired.
pub struct Easy2Handle {
+ // Safety: This *must* be before `easy` as it must be dropped first.
+ guard: DetachGuard,
easy: Easy2,
// This is now effectively bound to a `Multi`, so it is no longer sendable.
_marker: marker::PhantomData<&'static Multi>,
}
+/// A guard struct which guarantees that `curl_multi_remove_handle` will be
+/// called on an easy handle, either manually or on drop.
+struct DetachGuard {
+ multi: Arc,
+ easy: *mut curl_sys::CURL,
+}
+
/// Notification of the events that have happened on a socket.
///
/// This type is passed as an argument to the `action` method on a multi handle
@@ -92,6 +109,20 @@
inner: curl_sys::curl_waitfd,
}
+/// A handle that can be used to wake up a thread that's blocked in [Multi::poll].
+/// The handle can be passed to and used from any thread.
+#[cfg(feature = "poll_7_68_0")]
+#[derive(Debug, Clone)]
+pub struct MultiWaker {
+ raw: std::sync::Weak,
+}
+
+#[cfg(feature = "poll_7_68_0")]
+unsafe impl Send for MultiWaker {}
+
+#[cfg(feature = "poll_7_68_0")]
+unsafe impl Sync for MultiWaker {}
+
impl Multi {
/// Creates a new multi session through which multiple HTTP transfers can be
/// initiated.
@@ -101,7 +132,7 @@
let ptr = curl_sys::curl_multi_init();
assert!(!ptr.is_null());
Multi {
- raw: ptr,
+ raw: Arc::new(RawMulti { handle: ptr }),
data: Box::new(MultiData {
socket: Box::new(|_, _, _| ()),
timer: Box::new(|_| true),
@@ -196,7 +227,7 @@
pub fn assign(&self, socket: Socket, token: usize) -> Result<(), MultiError> {
unsafe {
cvt(curl_sys::curl_multi_assign(
- self.raw,
+ self.raw.handle,
socket,
token as *mut _,
))?;
@@ -341,7 +372,7 @@
}
fn setopt_long(&mut self, opt: curl_sys::CURLMoption, val: c_long) -> Result<(), MultiError> {
- unsafe { cvt(curl_sys::curl_multi_setopt(self.raw, opt, val)) }
+ unsafe { cvt(curl_sys::curl_multi_setopt(self.raw.handle, opt, val)) }
}
fn setopt_ptr(
@@ -349,7 +380,7 @@
opt: curl_sys::CURLMoption,
val: *const c_char,
) -> Result<(), MultiError> {
- unsafe { cvt(curl_sys::curl_multi_setopt(self.raw, opt, val)) }
+ unsafe { cvt(curl_sys::curl_multi_setopt(self.raw.handle, opt, val)) }
}
/// Add an easy handle to a multi session
@@ -377,9 +408,13 @@
easy.transfer();
unsafe {
- cvt(curl_sys::curl_multi_add_handle(self.raw, easy.raw()))?;
+ cvt(curl_sys::curl_multi_add_handle(self.raw.handle, easy.raw()))?;
}
Ok(EasyHandle {
+ guard: DetachGuard {
+ multi: self.raw.clone(),
+ easy: easy.raw(),
+ },
easy,
_marker: marker::PhantomData,
})
@@ -388,9 +423,13 @@
/// Same as `add`, but works with the `Easy2` type.
pub fn add2(&self, easy: Easy2) -> Result, MultiError> {
unsafe {
- cvt(curl_sys::curl_multi_add_handle(self.raw, easy.raw()))?;
+ cvt(curl_sys::curl_multi_add_handle(self.raw.handle, easy.raw()))?;
}
Ok(Easy2Handle {
+ guard: DetachGuard {
+ multi: self.raw.clone(),
+ easy: easy.raw(),
+ },
easy,
_marker: marker::PhantomData,
})
@@ -407,24 +446,14 @@
/// Removing an easy handle while being used is perfectly legal and will
/// effectively halt the transfer in progress involving that easy handle.
/// All other easy handles and transfers will remain unaffected.
- pub fn remove(&self, easy: EasyHandle) -> Result {
- unsafe {
- cvt(curl_sys::curl_multi_remove_handle(
- self.raw,
- easy.easy.raw(),
- ))?;
- }
+ pub fn remove(&self, mut easy: EasyHandle) -> Result {
+ easy.guard.detach()?;
Ok(easy.easy)
}
/// Same as `remove`, but for `Easy2Handle`.
- pub fn remove2(&self, easy: Easy2Handle) -> Result, MultiError> {
- unsafe {
- cvt(curl_sys::curl_multi_remove_handle(
- self.raw,
- easy.easy.raw(),
- ))?;
- }
+ pub fn remove2(&self, mut easy: Easy2Handle) -> Result, MultiError> {
+ easy.guard.detach()?;
Ok(easy.easy)
}
@@ -445,7 +474,7 @@
let mut queue = 0;
unsafe {
loop {
- let ptr = curl_sys::curl_multi_info_read(self.raw, &mut queue);
+ let ptr = curl_sys::curl_multi_info_read(self.raw.handle, &mut queue);
if ptr.is_null() {
break;
}
@@ -479,7 +508,7 @@
let mut remaining = 0;
unsafe {
cvt(curl_sys::curl_multi_socket_action(
- self.raw,
+ self.raw.handle,
socket,
events.bits,
&mut remaining,
@@ -507,7 +536,7 @@
let mut remaining = 0;
unsafe {
cvt(curl_sys::curl_multi_socket_action(
- self.raw,
+ self.raw.handle,
curl_sys::CURL_SOCKET_BAD,
0,
&mut remaining,
@@ -536,7 +565,7 @@
pub fn get_timeout(&self) -> Result
, MultiError> {
let mut ms = 0;
unsafe {
- cvt(curl_sys::curl_multi_timeout(self.raw, &mut ms))?;
+ cvt(curl_sys::curl_multi_timeout(self.raw.handle, &mut ms))?;
if ms == -1 {
Ok(None)
} else {
@@ -571,19 +600,72 @@
/// }
/// ```
pub fn wait(&self, waitfds: &mut [WaitFd], timeout: Duration) -> Result {
- let timeout_ms = {
- let secs = timeout.as_secs();
- if secs > (i32::max_value() / 1000) as u64 {
- // Duration too large, clamp at maximum value.
- i32::max_value()
- } else {
- secs as i32 * 1000 + timeout.subsec_nanos() as i32 / 1_000_000
- }
- };
+ let timeout_ms = Multi::timeout_i32(timeout);
unsafe {
let mut ret = 0;
cvt(curl_sys::curl_multi_wait(
- self.raw,
+ self.raw.handle,
+ waitfds.as_mut_ptr() as *mut _,
+ waitfds.len() as u32,
+ timeout_ms,
+ &mut ret,
+ ))?;
+ Ok(ret as u32)
+ }
+ }
+
+ fn timeout_i32(timeout: Duration) -> i32 {
+ let secs = timeout.as_secs();
+ if secs > (i32::MAX / 1000) as u64 {
+ // Duration too large, clamp at maximum value.
+ i32::MAX
+ } else {
+ secs as i32 * 1000 + timeout.subsec_nanos() as i32 / 1_000_000
+ }
+ }
+
+ /// Block until activity is detected or a timeout passes.
+ ///
+ /// The timeout is used in millisecond-precision. Large durations are
+ /// clamped at the maximum value curl accepts.
+ ///
+ /// The returned integer will contain the number of internal file
+ /// descriptors on which interesting events occurred.
+ ///
+ /// This function is a simpler alternative to using `fdset()` and `select()`
+ /// and does not suffer from file descriptor limits.
+ ///
+ /// While this method is similar to [Multi::wait], with the following
+ /// distinctions:
+ /// * If there are no handles added to the multi, poll will honor the
+ /// provided timeout, while [Multi::wait] returns immediately.
+ /// * If poll has blocked due to there being no activity on the handles in
+ /// the Multi, it can be woken up from any thread and at any time before
+ /// the timeout expires.
+ ///
+ /// Requires libcurl 7.66.0 or later.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// use curl::multi::Multi;
+ /// use std::time::Duration;
+ ///
+ /// let m = Multi::new();
+ ///
+ /// // Add some Easy handles...
+ ///
+ /// while m.perform().unwrap() > 0 {
+ /// m.poll(&mut [], Duration::from_secs(1)).unwrap();
+ /// }
+ /// ```
+ #[cfg(feature = "poll_7_68_0")]
+ pub fn poll(&self, waitfds: &mut [WaitFd], timeout: Duration) -> Result {
+ let timeout_ms = Multi::timeout_i32(timeout);
+ unsafe {
+ let mut ret = 0;
+ cvt(curl_sys::curl_multi_poll(
+ self.raw.handle,
waitfds.as_mut_ptr() as *mut _,
waitfds.len() as u32,
timeout_ms,
@@ -593,6 +675,13 @@
}
}
+ /// Returns a new [MultiWaker] that can be used to wake up a thread that's
+ /// currently blocked in [Multi::poll].
+ #[cfg(feature = "poll_7_68_0")]
+ pub fn waker(&self) -> MultiWaker {
+ MultiWaker::new(Arc::downgrade(&self.raw))
+ }
+
/// Reads/writes available data from each easy handle.
///
/// This function handles transfers on all the added handles that need
@@ -636,7 +725,7 @@
pub fn perform(&self) -> Result {
unsafe {
let mut ret = 0;
- cvt(curl_sys::curl_multi_perform(self.raw, &mut ret))?;
+ cvt(curl_sys::curl_multi_perform(self.raw.handle, &mut ret))?;
Ok(ret as u32)
}
}
@@ -684,7 +773,11 @@
let write = write.map(|r| r as *mut _).unwrap_or(ptr::null_mut());
let except = except.map(|r| r as *mut _).unwrap_or(ptr::null_mut());
cvt(curl_sys::curl_multi_fdset(
- self.raw, read, write, except, &mut ret,
+ self.raw.handle,
+ read,
+ write,
+ except,
+ &mut ret,
))?;
if ret == -1 {
Ok(None)
@@ -710,11 +803,38 @@
/// Get a pointer to the raw underlying CURLM handle.
pub fn raw(&self) -> *mut curl_sys::CURLM {
- self.raw
+ self.raw.handle
}
+}
- unsafe fn close_impl(&self) -> Result<(), MultiError> {
- cvt(curl_sys::curl_multi_cleanup(self.raw))
+impl Drop for RawMulti {
+ fn drop(&mut self) {
+ unsafe {
+ let _ = cvt(curl_sys::curl_multi_cleanup(self.handle));
+ }
+ }
+}
+
+#[cfg(feature = "poll_7_68_0")]
+impl MultiWaker {
+ /// Creates a new MultiWaker handle.
+ fn new(raw: std::sync::Weak) -> Self {
+ Self { raw }
+ }
+
+ /// Wakes up a thread that is blocked in [Multi::poll]. This method can be
+ /// invoked from any thread.
+ ///
+ /// Will return an error if the RawMulti has already been dropped.
+ ///
+ /// Requires libcurl 7.68.0 or later.
+ pub fn wakeup(&self) -> Result<(), MultiError> {
+ if let Some(raw) = self.raw.upgrade() {
+ unsafe { cvt(curl_sys::curl_multi_wakeup(raw.handle)) }
+ } else {
+ // This happens if the RawMulti has already been dropped:
+ Err(MultiError::new(curl_sys::CURLM_BAD_HANDLE))
+ }
}
}
@@ -732,12 +852,6 @@
}
}
-impl Drop for Multi {
- fn drop(&mut self) {
- let _ = unsafe { self.close_impl() };
- }
-}
-
macro_rules! impl_easy_getters {
() => {
impl_easy_getters! {
@@ -913,6 +1027,32 @@
}
}
+impl DetachGuard {
+ /// Detach the referenced easy handle from its multi handle manually.
+ /// Subsequent calls to this method will have no effect.
+ fn detach(&mut self) -> Result<(), MultiError> {
+ if !self.easy.is_null() {
+ unsafe {
+ cvt(curl_sys::curl_multi_remove_handle(
+ self.multi.handle,
+ self.easy,
+ ))?
+ }
+
+ // Set easy to null to signify that the handle was removed.
+ self.easy = ptr::null_mut();
+ }
+
+ Ok(())
+ }
+}
+
+impl Drop for DetachGuard {
+ fn drop(&mut self) {
+ let _ = self.detach();
+ }
+}
+
impl<'multi> Message<'multi> {
/// If this message indicates that a transfer has finished, returns the
/// result of the transfer in `Some`.
diff -Nru cargo-0.58.0/vendor/curl/src/version.rs cargo-0.60.0ubuntu1/vendor/curl/src/version.rs
--- cargo-0.58.0/vendor/curl/src/version.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/src/version.rs 2022-04-20 13:48:09.000000000 +0000
@@ -2,7 +2,6 @@
use std::fmt;
use std::str;
-use curl_sys;
use libc::{c_char, c_int};
/// Version information about libcurl and the capabilities that it supports.
diff -Nru cargo-0.58.0/vendor/curl/tests/easy.rs cargo-0.60.0ubuntu1/vendor/curl/tests/easy.rs
--- cargo-0.58.0/vendor/curl/tests/easy.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/tests/easy.rs 2022-04-20 13:48:09.000000000 +0000
@@ -22,7 +22,7 @@
fn handle() -> Easy {
let mut e = Easy::new();
t!(e.timeout(Duration::new(20, 0)));
- return e;
+ e
}
fn sink(data: &[u8]) -> Result {
diff -Nru cargo-0.58.0/vendor/curl/tests/multi.rs cargo-0.60.0ubuntu1/vendor/curl/tests/multi.rs
--- cargo-0.58.0/vendor/curl/tests/multi.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/tests/multi.rs 2022-04-20 13:48:09.000000000 +0000
@@ -150,10 +150,8 @@
while running {
let n = t!(poll.poll(&mut events, cur_timeout));
- if n == 0 {
- if t!(m.timeout()) == 0 {
- running = false;
- }
+ if n == 0 && t!(m.timeout()) == 0 {
+ running = false;
}
for event in events.iter() {
@@ -167,10 +165,10 @@
} else {
let mut e = mio::Ready::empty();
if events.input() {
- e = e | mio::Ready::readable();
+ e |= mio::Ready::readable();
}
if events.output() {
- e = e | mio::Ready::writable();
+ e |= mio::Ready::writable();
}
if token == 0 {
let token = next_token;
@@ -261,5 +259,39 @@
assert_eq!(events, 3);
for waitfd in waitfds {
assert!(waitfd.received_read());
+ }
+}
+
+// Tests passing raw file descriptors to Multi::wait. The test is limited to Linux only as the
+// semantics of the underlying poll(2) system call used by curl apparently differ on other
+// platforms, making the test fail.
+#[cfg(feature = "poll_7_68_0")]
+#[cfg(target_os = "linux")]
+#[test]
+fn pollfds() {
+ use curl::multi::WaitFd;
+ use std::fs::File;
+ use std::os::unix::io::AsRawFd;
+
+ let filenames = ["/dev/null", "/dev/zero", "/dev/urandom"];
+ let files: Vec = filenames
+ .iter()
+ .map(|filename| File::open(filename).unwrap())
+ .collect();
+ let mut waitfds: Vec = files
+ .iter()
+ .map(|f| {
+ let mut waitfd = WaitFd::new();
+ waitfd.set_fd(f.as_raw_fd());
+ waitfd.poll_on_read(true);
+ waitfd
+ })
+ .collect();
+
+ let m = Multi::new();
+ let events = t!(m.poll(&mut waitfds, Duration::from_secs(1)));
+ assert_eq!(events, 3);
+ for waitfd in waitfds {
+ assert!(waitfd.received_read());
}
}
diff -Nru cargo-0.58.0/vendor/curl/tests/post.rs cargo-0.60.0ubuntu1/vendor/curl/tests/post.rs
--- cargo-0.58.0/vendor/curl/tests/post.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/tests/post.rs 2022-04-20 13:48:09.000000000 +0000
@@ -20,7 +20,7 @@
let mut list = List::new();
t!(list.append("Expect:"));
t!(e.http_headers(list));
- return e;
+ e
}
#[test]
diff -Nru cargo-0.58.0/vendor/curl/tests/server/mod.rs cargo-0.60.0ubuntu1/vendor/curl/tests/server/mod.rs
--- cargo-0.58.0/vendor/curl/tests/server/mod.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl/tests/server/mod.rs 2022-04-20 13:48:09.000000000 +0000
@@ -31,7 +31,7 @@
Message::Read(ref expected) => {
let mut expected = &expected[..];
let mut expected_headers = HashSet::new();
- while let Some(i) = expected.find("\n") {
+ while let Some(i) = expected.find('\n') {
let line = &expected[..i + 1];
expected = &expected[i + 1..];
expected_headers.insert(line);
@@ -41,11 +41,11 @@
}
let mut expected_len = None;
- while expected_headers.len() > 0 {
+ while !expected_headers.is_empty() {
let mut actual = String::new();
t!(socket.read_line(&mut actual));
if actual.starts_with("Content-Length") {
- let len = actual.split(": ").skip(1).next().unwrap();
+ let len = actual.split(": ").nth(1).unwrap();
expected_len = len.trim().parse().ok();
}
// various versions of libcurl do different things here
@@ -84,13 +84,13 @@
while socket.limit() > 0 {
line.truncate(0);
t!(socket.read_line(&mut line));
- if line.len() == 0 {
+ if line.is_empty() {
break;
}
- if expected.len() == 0 {
+ if expected.is_empty() {
panic!("unexpected line: {:?}", line);
}
- let i = expected.find("\n").unwrap_or(expected.len() - 1);
+ let i = expected.find('\n').unwrap_or(expected.len() - 1);
let expected_line = &expected[..i + 1];
expected = &expected[i + 1..];
if lines_match(expected_line, &line) {
@@ -103,7 +103,7 @@
expected_line, line
)
}
- if expected.len() != 0 {
+ if !expected.is_empty() {
println!("didn't get expected data: {:?}", expected);
}
}
diff -Nru cargo-0.58.0/vendor/curl-sys/build.rs cargo-0.60.0ubuntu1/vendor/curl-sys/build.rs
--- cargo-0.58.0/vendor/curl-sys/build.rs 2022-01-21 02:49:38.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/build.rs 2022-04-20 13:48:09.000000000 +0000
@@ -4,11 +4,14 @@
use std::process::Command;
fn main() {
- println!("cargo:rerun-if-changed=curl");
let host = env::var("HOST").unwrap();
let target = env::var("TARGET").unwrap();
let windows = target.contains("windows");
+ if cfg!(feature = "mesalink") {
+ println!("cargo:warning=MesaLink support has been removed as of curl 7.82.0, will use default TLS backend instead.");
+ }
+
// This feature trumps all others, and is largely set by rustbuild to force
// usage of the system library to ensure that we're always building an
// ABI-compatible Cargo.
@@ -117,7 +120,6 @@
.define("CURL_DISABLE_IMAP", None)
.define("CURL_DISABLE_LDAP", None)
.define("CURL_DISABLE_LDAPS", None)
- .define("CURL_DISABLE_NTLM", None)
.define("CURL_DISABLE_POP3", None)
.define("CURL_DISABLE_RTSP", None)
.define("CURL_DISABLE_SMB", None)
@@ -160,12 +162,10 @@
.file("curl/lib/hash.c")
.file("curl/lib/hmac.c")
.file("curl/lib/hostasyn.c")
- .file("curl/lib/hostcheck.c")
.file("curl/lib/hostip.c")
.file("curl/lib/hostip6.c")
.file("curl/lib/hsts.c")
.file("curl/lib/http.c")
- .file("curl/lib/http2.c")
.file("curl/lib/http_aws_sigv4.c")
.file("curl/lib/http_chunks.c")
.file("curl/lib/http_digest.c")
@@ -207,6 +207,7 @@
.file("curl/lib/version.c")
.file("curl/lib/vauth/digest.c")
.file("curl/lib/vauth/vauth.c")
+ .file("curl/lib/vtls/hostcheck.c")
.file("curl/lib/vtls/keylog.c")
.file("curl/lib/vtls/vtls.c")
.file("curl/lib/warnless.c")
@@ -216,6 +217,20 @@
.define("HAVE_GETSOCKNAME", None)
.warnings(false);
+ if cfg!(feature = "ntlm") {
+ cfg.file("curl/lib/curl_des.c")
+ .file("curl/lib/curl_endian.c")
+ .file("curl/lib/curl_gethostname.c")
+ .file("curl/lib/curl_ntlm_core.c")
+ .file("curl/lib/curl_ntlm_wb.c")
+ .file("curl/lib/http_ntlm.c")
+ .file("curl/lib/md4.c")
+ .file("curl/lib/vauth/ntlm.c")
+ .file("curl/lib/vauth/ntlm_sspi.c");
+ } else {
+ cfg.define("CURL_DISABLE_NTLM", None);
+ }
+
if cfg!(feature = "protocol-ftp") {
cfg.file("curl/lib/curl_fnmatch.c")
.file("curl/lib/ftp.c")
@@ -227,7 +242,9 @@
if cfg!(feature = "http2") {
cfg.define("USE_NGHTTP2", None)
- .define("NGHTTP2_STATICLIB", None);
+ .define("NGHTTP2_STATICLIB", None)
+ .file("curl/lib/h2h3.c")
+ .file("curl/lib/http2.c");
println!("cargo:rustc-cfg=link_libnghttp2");
if let Some(path) = env::var_os("DEP_NGHTTP2_ROOT") {
@@ -249,19 +266,10 @@
// Configure TLS backend. Since Cargo does not support mutually exclusive
// features, make sure we only compile one vtls.
- if cfg!(feature = "mesalink") {
- cfg.define("USE_MESALINK", None)
- .file("curl/lib/vtls/mesalink.c");
-
- if let Some(path) = env::var_os("DEP_MESALINK_INCLUDE") {
- cfg.include(path);
- }
-
- if windows {
- cfg.define("HAVE_WINDOWS", None);
- } else {
- cfg.define("HAVE_UNIX", None);
- }
+ if cfg!(feature = "rustls") {
+ cfg.define("USE_RUSTLS", None)
+ .file("curl/lib/vtls/rustls.c")
+ .include(env::var_os("DEP_RUSTLS_FFI_INCLUDE").unwrap());
} else if cfg!(feature = "ssl") {
if windows {
// For windows, spnego feature is auto on in case ssl feature is on.
@@ -269,17 +277,17 @@
cfg.define("USE_WINDOWS_SSPI", None)
.define("USE_SCHANNEL", None)
.file("curl/lib/http_negotiate.c")
- .file("curl/lib/x509asn1.c")
.file("curl/lib/curl_sspi.c")
.file("curl/lib/socks_sspi.c")
.file("curl/lib/vauth/spnego_sspi.c")
.file("curl/lib/vauth/vauth.c")
.file("curl/lib/vtls/schannel.c")
- .file("curl/lib/vtls/schannel_verify.c");
+ .file("curl/lib/vtls/schannel_verify.c")
+ .file("curl/lib/vtls/x509asn1.c");
} else if target.contains("-apple-") {
cfg.define("USE_SECTRANSP", None)
- .file("curl/lib/x509asn1.c")
- .file("curl/lib/vtls/sectransp.c");
+ .file("curl/lib/vtls/sectransp.c")
+ .file("curl/lib/vtls/x509asn1.c");
if xcode_major_version().map_or(true, |v| v >= 9) {
// On earlier Xcode versions (<9), defining HAVE_BUILTIN_AVAILABLE
// would cause __bultin_available() to fail to compile due to
@@ -498,14 +506,17 @@
}
fn xcode_major_version() -> Option {
- let output = Command::new("xcodebuild").arg("-version").output().ok()?;
- if output.status.success() {
- let stdout = String::from_utf8_lossy(&output.stdout);
- println!("xcode version: {}", stdout);
- let mut words = stdout.split_whitespace();
- if words.next()? == "Xcode" {
- let version = words.next()?;
- return version[..version.find('.')?].parse().ok();
+ let status = Command::new("xcode-select").arg("-p").status().ok()?;
+ if status.success() {
+ let output = Command::new("xcodebuild").arg("-version").output().ok()?;
+ if output.status.success() {
+ let stdout = String::from_utf8_lossy(&output.stdout);
+ println!("xcode version: {}", stdout);
+ let mut words = stdout.split_whitespace();
+ if words.next()? == "Xcode" {
+ let version = words.next()?;
+ return version[..version.find('.')?].parse().ok();
+ }
}
}
println!("unable to determine Xcode version, assuming >= 9");
@@ -552,8 +563,10 @@
let stdout = String::from_utf8_lossy(&output.stdout);
for line in stdout.lines() {
if line.contains("libraries: =") {
- let path = line.split('=').skip(1).next()?;
- return Some(format!("{}/lib/darwin", path));
+ let path = line.split('=').nth(1)?;
+ if !path.is_empty() {
+ return Some(format!("{}/lib/darwin", path));
+ }
}
}
diff -Nru cargo-0.58.0/vendor/curl-sys/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/curl-sys/.cargo-checksum.json
--- cargo-0.58.0/vendor/curl-sys/.cargo-checksum.json 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"e0f44960aea24a786a46907b8824ebc0e66ca06bf4e4978408c7499620343483"}
\ No newline at end of file
+{"files":{},"package":"8092905a5a9502c312f223b2775f57ec5c5b715f9a15ee9d2a8591d1364a0352"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/curl-sys/Cargo.toml cargo-0.60.0ubuntu1/vendor/curl-sys/Cargo.toml
--- cargo-0.58.0/vendor/curl-sys/Cargo.toml 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "curl-sys"
-version = "0.4.49+curl-7.79.1"
+version = "0.4.53+curl-7.82.0"
authors = ["Alex Crichton "]
build = "build.rs"
links = "curl"
@@ -32,6 +32,10 @@
version = "0.1.3"
optional = true
+[dependencies.rustls-ffi]
+version = "0.8"
+features = ["no_log_capture"]
+optional = true
[build-dependencies.cc]
version = "1.0"
@@ -42,7 +46,11 @@
default = ["ssl"]
force-system-lib-on-osx = []
http2 = ["libnghttp2-sys"]
+mesalink = []
+ntlm = []
+poll_7_68_0 = []
protocol-ftp = []
+rustls = ["rustls-ffi"]
spnego = []
ssl = ["openssl-sys"]
static-curl = []
diff -Nru cargo-0.58.0/vendor/curl-sys/debian/patches/avoid-spurious-rebuilds.patch cargo-0.60.0ubuntu1/vendor/curl-sys/debian/patches/avoid-spurious-rebuilds.patch
--- cargo-0.58.0/vendor/curl-sys/debian/patches/avoid-spurious-rebuilds.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/debian/patches/avoid-spurious-rebuilds.patch 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,12 @@
+Since we excluded the "curl" source code directory, this check is no longer
+applicable and would always lead to rebuilds since the file is non-existent.
+--- a/build.rs
++++ b/build.rs
+@@ -4,7 +4,6 @@
+ use std::process::Command;
+
+ fn main() {
+- println!("cargo:rerun-if-changed=curl");
+ let host = env::var("HOST").unwrap();
+ let target = env::var("TARGET").unwrap();
+ let windows = target.contains("windows");
diff -Nru cargo-0.58.0/vendor/curl-sys/debian/patches/disable-libz-sys.patch cargo-0.60.0ubuntu1/vendor/curl-sys/debian/patches/disable-libz-sys.patch
--- cargo-0.58.0/vendor/curl-sys/debian/patches/disable-libz-sys.patch 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/debian/patches/disable-libz-sys.patch 2022-04-20 13:48:09.000000000 +0000
@@ -11,9 +11,9 @@
-features = ["libc"]
-default-features = false
-
- [build-dependencies.cc]
- version = "1.0"
-
+ [dependencies.rustls-ffi]
+ version = "0.8"
+ features = ["no_log_capture"]
@@ -53,7 +48,6 @@
static-curl = []
static-ssl = ["openssl-sys"]
diff -Nru cargo-0.58.0/vendor/curl-sys/debian/patches/series cargo-0.60.0ubuntu1/vendor/curl-sys/debian/patches/series
--- cargo-0.58.0/vendor/curl-sys/debian/patches/series 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -1,3 +1,3 @@
-disable-mesalink.patch
+avoid-spurious-rebuilds.patch
disable-vendor.patch
disable-libz-sys.patch
diff -Nru cargo-0.58.0/vendor/curl-sys/lib.rs cargo-0.60.0ubuntu1/vendor/curl-sys/lib.rs
--- cargo-0.58.0/vendor/curl-sys/lib.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/curl-sys/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -6,10 +6,10 @@
extern crate libnghttp2_sys;
#[cfg(link_libz)]
extern crate libz_sys;
-#[cfg(feature = "mesalink")]
-extern crate mesalink;
#[cfg(link_openssl)]
extern crate openssl_sys;
+#[cfg(feature = "rustls")]
+extern crate rustls_ffi;
use libc::c_ulong;
use libc::{c_char, c_double, c_int, c_long, c_short, c_uint, c_void, size_t, time_t};
@@ -595,6 +595,7 @@
pub const CURLOPT_PROXY_SSLCERT: CURLoption = CURLOPTTYPE_OBJECTPOINT + 254;
pub const CURLOPT_PROXY_SSLKEY: CURLoption = CURLOPTTYPE_OBJECTPOINT + 256;
+pub const CURLOPT_DOH_URL: CURLoption = CURLOPTTYPE_OBJECTPOINT + 279;
pub const CURLOPT_UPLOAD_BUFFERSIZE: CURLoption = CURLOPTTYPE_LONG + 280;
pub const CURLOPT_MAXAGE_CONN: CURLoption = CURLOPTTYPE_LONG + 288;
@@ -607,6 +608,11 @@
pub const CURLOPT_AWS_SIGV4: CURLoption = CURLOPTTYPE_OBJECTPOINT + 305;
+pub const CURLOPT_DOH_SSL_VERIFYPEER: CURLoption = CURLOPTTYPE_LONG + 306;
+pub const CURLOPT_DOH_SSL_VERIFYHOST: CURLoption = CURLOPTTYPE_LONG + 307;
+pub const CURLOPT_DOH_SSL_VERIFYSTATUS: CURLoption = CURLOPTTYPE_LONG + 308;
+pub const CURLOPT_CAINFO_BLOB: CURLoption = CURLOPTTYPE_BLOB + 309;
+
pub const CURL_IPRESOLVE_WHATEVER: c_int = 0;
pub const CURL_IPRESOLVE_V4: c_int = 1;
pub const CURL_IPRESOLVE_V6: c_int = 2;
@@ -1079,6 +1085,19 @@
timeout_ms: c_int,
ret: *mut c_int,
) -> CURLMcode;
+
+ #[cfg(feature = "poll_7_68_0")]
+ pub fn curl_multi_poll(
+ multi_handle: *mut CURLM,
+ extra_fds: *mut curl_waitfd,
+ extra_nfds: c_uint,
+ timeout_ms: c_int,
+ ret: *mut c_int,
+ ) -> CURLMcode;
+
+ #[cfg(feature = "poll_7_68_0")]
+ pub fn curl_multi_wakeup(multi_handle: *mut CURLM) -> CURLMcode;
+
pub fn curl_multi_perform(multi_handle: *mut CURLM, running_handles: *mut c_int) -> CURLMcode;
pub fn curl_multi_cleanup(multi_handle: *mut CURLM) -> CURLMcode;
pub fn curl_multi_info_read(
diff -Nru cargo-0.58.0/vendor/fastrand/benches/bench.rs cargo-0.60.0ubuntu1/vendor/fastrand/benches/bench.rs
--- cargo-0.58.0/vendor/fastrand/benches/bench.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/benches/bench.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,75 @@
+#![feature(test)]
+
+extern crate test;
+
+use rand::prelude::*;
+use test::Bencher;
+use wyhash::WyRng;
+
+#[bench]
+fn shuffle_wyhash(b: &mut Bencher) {
+ let mut rng = WyRng::from_rng(thread_rng()).unwrap();
+ let mut x = (0..100).collect::>();
+ b.iter(|| {
+ x.shuffle(&mut rng);
+ x[0]
+ })
+}
+
+#[bench]
+fn shuffle_fastrand(b: &mut Bencher) {
+ let rng = fastrand::Rng::new();
+ let mut x = (0..100).collect::>();
+ b.iter(|| {
+ rng.shuffle(&mut x);
+ x[0]
+ })
+}
+
+#[bench]
+fn u8_wyhash(b: &mut Bencher) {
+ let mut rng = WyRng::from_rng(thread_rng()).unwrap();
+ b.iter(|| {
+ let mut sum = 0u8;
+ for _ in 0..10_000 {
+ sum = sum.wrapping_add(rng.gen::());
+ }
+ sum
+ })
+}
+
+#[bench]
+fn u8_fastrand(b: &mut Bencher) {
+ let rng = fastrand::Rng::new();
+ b.iter(|| {
+ let mut sum = 0u8;
+ for _ in 0..10_000 {
+ sum = sum.wrapping_add(rng.u8(..));
+ }
+ sum
+ })
+}
+
+#[bench]
+fn u32_wyhash(b: &mut Bencher) {
+ let mut rng = WyRng::from_rng(thread_rng()).unwrap();
+ b.iter(|| {
+ let mut sum = 0u32;
+ for _ in 0..10_000 {
+ sum = sum.wrapping_add(rng.gen::());
+ }
+ sum
+ })
+}
+
+#[bench]
+fn u32_fastrand(b: &mut Bencher) {
+ let rng = fastrand::Rng::new();
+ b.iter(|| {
+ let mut sum = 0u32;
+ for _ in 0..10_000 {
+ sum = sum.wrapping_add(rng.u32(..));
+ }
+ sum
+ })
+}
diff -Nru cargo-0.58.0/vendor/fastrand/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/fastrand/.cargo-checksum.json
--- cargo-0.58.0/vendor/fastrand/.cargo-checksum.json 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1 @@
+{"files":{},"package":"c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/fastrand/Cargo.toml cargo-0.60.0ubuntu1/vendor/fastrand/Cargo.toml
--- cargo-0.58.0/vendor/fastrand/Cargo.toml 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,31 @@
+# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
+#
+# When uploading crates to the registry Cargo will automatically
+# "normalize" Cargo.toml files for maximal compatibility
+# with all versions of Cargo and also rewrite `path` dependencies
+# to registry (e.g., crates.io) dependencies.
+#
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
+
+[package]
+edition = "2018"
+rust-version = "1.34"
+name = "fastrand"
+version = "1.7.0"
+authors = ["Stjepan Glavina "]
+exclude = ["/.*"]
+description = "A simple and fast random number generator"
+keywords = ["simple", "fast", "rand", "random", "wyrand"]
+categories = ["algorithms"]
+license = "Apache-2.0 OR MIT"
+repository = "https://github.com/smol-rs/fastrand"
+[dev-dependencies.getrandom]
+version = "0.2"
+
+[dev-dependencies.rand]
+version = "0.8"
+
+[dev-dependencies.wyhash]
+version = "0.5"
diff -Nru cargo-0.58.0/vendor/fastrand/CHANGELOG.md cargo-0.60.0ubuntu1/vendor/fastrand/CHANGELOG.md
--- cargo-0.58.0/vendor/fastrand/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/CHANGELOG.md 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,77 @@
+# Version 1.7.0
+
+- Add `char()` and `Rng::char()` (#25)
+
+# Version 1.6.0
+
+- Implement `PartialEq` and `Eq` for `Rng` (#23)
+
+# Version 1.5.0
+
+- Switch to Wyrand (#14)
+
+# Version 1.4.1
+
+- Fix bug when generating a signed integer within a range (#16)
+
+# Version 1.4.0
+
+- Add wasm support.
+
+# Version 1.3.5
+
+- Reword docs.
+- Add `Rng::with_seed()`.
+
+# Version 1.3.4
+
+- Implement `Clone` for `Rng`.
+
+# Version 1.3.3
+
+- Forbid unsafe code.
+
+# Version 1.3.2
+
+- Support older Rust versions.
+
+# Version 1.3.1
+
+- Tweak Cargo keywords.
+
+# Version 1.3.0
+
+- Add `f32()` and `f64()`.
+- Add `lowercase()`, `uppercase()`, `alphabetic()`, and `digit()`.
+
+# Version 1.2.4
+
+- Switch to PCG XSH RR 64/32.
+- Fix a bug in `gen_mod_u128`.
+- Fix bias in ranges.
+
+# Version 1.2.3
+
+- Support Rust 1.32.0
+
+# Version 1.2.2
+
+- Use `std::$t::MAX` rather than `$t::MAX` to support older Rust versions.
+
+# Version 1.2.1
+
+- Inline all functions.
+
+# Version 1.2.0
+
+- Add `Rng` struct.
+
+# Version 1.1.0
+
+- Switch to PCG implementation.
+- Add `alphanumeric()`.
+- Add `seed()`.
+
+# Version 1.0.0
+
+- Initial version
diff -Nru cargo-0.58.0/vendor/fastrand/debian/patches/no-wasm.patch cargo-0.60.0ubuntu1/vendor/fastrand/debian/patches/no-wasm.patch
--- cargo-0.58.0/vendor/fastrand/debian/patches/no-wasm.patch 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/debian/patches/no-wasm.patch 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,18 @@
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -31,15 +31,3 @@ version = "0.7.3"
+
+ [dev-dependencies.wyhash]
+ version = "0.5"
+-[target."cfg(target_arch = \"wasm32\")".dependencies.instant]
+-version = "0.1"
+-[target."cfg(target_arch = \"wasm32\")".dev-dependencies.getrandom]
+-version = "0.2"
+-features = ["js"]
+-
+-[target."cfg(target_arch = \"wasm32\")".dev-dependencies.instant]
+-version = "0.1"
+-features = ["wasm-bindgen"]
+-
+-[target."cfg(target_arch = \"wasm32\")".dev-dependencies.wasm-bindgen-test]
+-version = "0.3"
diff -Nru cargo-0.58.0/vendor/fastrand/debian/patches/no-wasm.patch.orig cargo-0.60.0ubuntu1/vendor/fastrand/debian/patches/no-wasm.patch.orig
--- cargo-0.58.0/vendor/fastrand/debian/patches/no-wasm.patch.orig 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/debian/patches/no-wasm.patch.orig 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,8 @@
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -31,5 +31,3 @@ version = "0.7.3"
+
+ [dev-dependencies.rand_pcg]
+ version = "0.2.1"
+-[target."cfg(target_arch = \"wasm32\")".dependencies.instant]
+-version = "0.1"
diff -Nru cargo-0.58.0/vendor/fastrand/debian/patches/series cargo-0.60.0ubuntu1/vendor/fastrand/debian/patches/series
--- cargo-0.58.0/vendor/fastrand/debian/patches/series 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1 @@
+no-wasm.patch
diff -Nru cargo-0.58.0/vendor/fastrand/LICENSE-APACHE cargo-0.60.0ubuntu1/vendor/fastrand/LICENSE-APACHE
--- cargo-0.58.0/vendor/fastrand/LICENSE-APACHE 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/LICENSE-APACHE 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright [yyyy] [name of copyright owner]
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff -Nru cargo-0.58.0/vendor/fastrand/LICENSE-MIT cargo-0.60.0ubuntu1/vendor/fastrand/LICENSE-MIT
--- cargo-0.58.0/vendor/fastrand/LICENSE-MIT 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/LICENSE-MIT 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,23 @@
+Permission is hereby granted, free of charge, to any
+person obtaining a copy of this software and associated
+documentation files (the "Software"), to deal in the
+Software without restriction, including without
+limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software
+is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice
+shall be included in all copies or substantial portions
+of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
+SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
+IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff -Nru cargo-0.58.0/vendor/fastrand/README.md cargo-0.60.0ubuntu1/vendor/fastrand/README.md
--- cargo-0.58.0/vendor/fastrand/README.md 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/README.md 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,92 @@
+# fastrand
+
+[![Build](https://github.com/smol-rs/fastrand/workflows/Build%20and%20test/badge.svg)](
+https://github.com/smol-rs/fastrand/actions)
+[![License](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)](
+https://github.com/smol-rs/fastrand)
+[![Cargo](https://img.shields.io/crates/v/fastrand.svg)](
+https://crates.io/crates/fastrand)
+[![Documentation](https://docs.rs/fastrand/badge.svg)](
+https://docs.rs/fastrand)
+
+A simple and fast random number generator.
+
+The implementation uses [Wyrand](https://github.com/wangyi-fudan/wyhash), a simple and fast
+generator but **not** cryptographically secure.
+
+## Examples
+
+Flip a coin:
+
+```rust
+if fastrand::bool() {
+ println!("heads");
+} else {
+ println!("tails");
+}
+```
+
+Generate a random `i32`:
+
+```rust
+let num = fastrand::i32(..);
+```
+
+Choose a random element in an array:
+
+```rust
+let v = vec![1, 2, 3, 4, 5];
+let i = fastrand::usize(..v.len());
+let elem = v[i];
+```
+
+Shuffle an array:
+
+```rust
+let mut v = vec![1, 2, 3, 4, 5];
+fastrand::shuffle(&mut v);
+```
+
+Generate a random `Vec` or `String`:
+
+```rust
+use std::iter::repeat_with;
+
+let v: Vec = repeat_with(|| fastrand::i32(..)).take(10).collect();
+let s: String = repeat_with(fastrand::alphanumeric).take(10).collect();
+```
+
+To get reproducible results on every run, initialize the generator with a seed:
+
+```rust
+// Pick an arbitrary number as seed.
+fastrand::seed(7);
+
+// Now this prints the same number on every run:
+println!("{}", fastrand::u32(..));
+```
+
+To be more efficient, create a new `Rng` instance instead of using the thread-local
+generator:
+
+```rust
+use std::iter::repeat_with;
+
+let rng = fastrand::Rng::new();
+let mut bytes: Vec = repeat_with(|| rng.u8(..)).take(10_000).collect();
+```
+
+## License
+
+Licensed under either of
+
+ * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
+ * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
+
+at your option.
+
+#### Contribution
+
+Unless you explicitly state otherwise, any contribution intentionally submitted
+for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
+dual licensed as above, without any additional terms or conditions.
diff -Nru cargo-0.58.0/vendor/fastrand/src/lib.rs cargo-0.60.0ubuntu1/vendor/fastrand/src/lib.rs
--- cargo-0.58.0/vendor/fastrand/src/lib.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/src/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,668 @@
+//! A simple and fast random number generator.
+//!
+//! The implementation uses [Wyrand](https://github.com/wangyi-fudan/wyhash), a simple and fast
+//! generator but **not** cryptographically secure.
+//!
+//! # Examples
+//!
+//! Flip a coin:
+//!
+//! ```
+//! if fastrand::bool() {
+//! println!("heads");
+//! } else {
+//! println!("tails");
+//! }
+//! ```
+//!
+//! Generate a random `i32`:
+//!
+//! ```
+//! let num = fastrand::i32(..);
+//! ```
+//!
+//! Choose a random element in an array:
+//!
+//! ```
+//! let v = vec![1, 2, 3, 4, 5];
+//! let i = fastrand::usize(..v.len());
+//! let elem = v[i];
+//! ```
+//!
+//! Shuffle an array:
+//!
+//! ```
+//! let mut v = vec![1, 2, 3, 4, 5];
+//! fastrand::shuffle(&mut v);
+//! ```
+//!
+//! Generate a random [`Vec`] or [`String`]:
+//!
+//! ```
+//! use std::iter::repeat_with;
+//!
+//! let v: Vec = repeat_with(|| fastrand::i32(..)).take(10).collect();
+//! let s: String = repeat_with(fastrand::alphanumeric).take(10).collect();
+//! ```
+//!
+//! To get reproducible results on every run, initialize the generator with a seed:
+//!
+//! ```
+//! // Pick an arbitrary number as seed.
+//! fastrand::seed(7);
+//!
+//! // Now this prints the same number on every run:
+//! println!("{}", fastrand::u32(..));
+//! ```
+//!
+//! To be more efficient, create a new [`Rng`] instance instead of using the thread-local
+//! generator:
+//!
+//! ```
+//! use std::iter::repeat_with;
+//!
+//! let rng = fastrand::Rng::new();
+//! let mut bytes: Vec = repeat_with(|| rng.u8(..)).take(10_000).collect();
+//! ```
+
+#![forbid(unsafe_code)]
+#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
+
+use std::cell::Cell;
+use std::collections::hash_map::DefaultHasher;
+use std::hash::{Hash, Hasher};
+use std::ops::{Bound, RangeBounds};
+use std::thread;
+
+#[cfg(target_arch = "wasm32")]
+use instant::Instant;
+#[cfg(not(target_arch = "wasm32"))]
+use std::time::Instant;
+
+/// A random number generator.
+#[derive(Debug, PartialEq, Eq)]
+pub struct Rng(Cell);
+
+impl Default for Rng {
+ #[inline]
+ fn default() -> Rng {
+ Rng::new()
+ }
+}
+
+impl Clone for Rng {
+ /// Clones the generator by deterministically deriving a new generator based on the initial
+ /// seed.
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// // Seed two generators equally, and clone both of them.
+ /// let base1 = fastrand::Rng::new();
+ /// base1.seed(0x4d595df4d0f33173);
+ /// base1.bool(); // Use the generator once.
+ ///
+ /// let base2 = fastrand::Rng::new();
+ /// base2.seed(0x4d595df4d0f33173);
+ /// base2.bool(); // Use the generator once.
+ ///
+ /// let rng1 = base1.clone();
+ /// let rng2 = base2.clone();
+ ///
+ /// assert_eq!(rng1.u64(..), rng2.u64(..), "the cloned generators are identical");
+ /// ```
+ fn clone(&self) -> Rng {
+ Rng::with_seed(self.gen_u64())
+ }
+}
+
+impl Rng {
+ /// Generates a random `u32`.
+ #[inline]
+ fn gen_u32(&self) -> u32 {
+ self.gen_u64() as u32
+ }
+
+ /// Generates a random `u64`.
+ #[inline]
+ fn gen_u64(&self) -> u64 {
+ let s = self.0.get().wrapping_add(0xA0761D6478BD642F);
+ self.0.set(s);
+ let t = u128::from(s) * u128::from(s ^ 0xE7037ED1A0B428DB);
+ (t as u64) ^ (t >> 64) as u64
+ }
+
+ /// Generates a random `u128`.
+ #[inline]
+ fn gen_u128(&self) -> u128 {
+ (u128::from(self.gen_u64()) << 64) | u128::from(self.gen_u64())
+ }
+
+ /// Generates a random `u32` in `0..n`.
+ #[inline]
+ fn gen_mod_u32(&self, n: u32) -> u32 {
+ // Adapted from: https://lemire.me/blog/2016/06/30/fast-random-shuffling/
+ let mut r = self.gen_u32();
+ let mut hi = mul_high_u32(r, n);
+ let mut lo = r.wrapping_mul(n);
+ if lo < n {
+ let t = n.wrapping_neg() % n;
+ while lo < t {
+ r = self.gen_u32();
+ hi = mul_high_u32(r, n);
+ lo = r.wrapping_mul(n);
+ }
+ }
+ hi
+ }
+
+ /// Generates a random `u64` in `0..n`.
+ #[inline]
+ fn gen_mod_u64(&self, n: u64) -> u64 {
+ // Adapted from: https://lemire.me/blog/2016/06/30/fast-random-shuffling/
+ let mut r = self.gen_u64();
+ let mut hi = mul_high_u64(r, n);
+ let mut lo = r.wrapping_mul(n);
+ if lo < n {
+ let t = n.wrapping_neg() % n;
+ while lo < t {
+ r = self.gen_u64();
+ hi = mul_high_u64(r, n);
+ lo = r.wrapping_mul(n);
+ }
+ }
+ hi
+ }
+
+ /// Generates a random `u128` in `0..n`.
+ #[inline]
+ fn gen_mod_u128(&self, n: u128) -> u128 {
+ // Adapted from: https://lemire.me/blog/2016/06/30/fast-random-shuffling/
+ let mut r = self.gen_u128();
+ let mut hi = mul_high_u128(r, n);
+ let mut lo = r.wrapping_mul(n);
+ if lo < n {
+ let t = n.wrapping_neg() % n;
+ while lo < t {
+ r = self.gen_u128();
+ hi = mul_high_u128(r, n);
+ lo = r.wrapping_mul(n);
+ }
+ }
+ hi
+ }
+}
+
+thread_local! {
+ static RNG: Rng = Rng(Cell::new({
+ let mut hasher = DefaultHasher::new();
+ Instant::now().hash(&mut hasher);
+ thread::current().id().hash(&mut hasher);
+ let hash = hasher.finish();
+ (hash << 1) | 1
+ }));
+}
+
+/// Computes `(a * b) >> 32`.
+#[inline]
+fn mul_high_u32(a: u32, b: u32) -> u32 {
+ (((a as u64) * (b as u64)) >> 32) as u32
+}
+
+/// Computes `(a * b) >> 64`.
+#[inline]
+fn mul_high_u64(a: u64, b: u64) -> u64 {
+ (((a as u128) * (b as u128)) >> 64) as u64
+}
+
+/// Computes `(a * b) >> 128`.
+#[inline]
+fn mul_high_u128(a: u128, b: u128) -> u128 {
+ // Adapted from: https://stackoverflow.com/a/28904636
+ let a_lo = a as u64 as u128;
+ let a_hi = (a >> 64) as u64 as u128;
+ let b_lo = b as u64 as u128;
+ let b_hi = (b >> 64) as u64 as u128;
+ let carry = (a_lo * b_lo) >> 64;
+ let carry = ((a_hi * b_lo) as u64 as u128 + (a_lo * b_hi) as u64 as u128 + carry) >> 64;
+ a_hi * b_hi + ((a_hi * b_lo) >> 64) + ((a_lo * b_hi) >> 64) + carry
+}
+
+macro_rules! rng_integer {
+ ($t:tt, $unsigned_t:tt, $gen:tt, $mod:tt, $doc:tt) => {
+ #[doc = $doc]
+ ///
+ /// Panics if the range is empty.
+ #[inline]
+ pub fn $t(&self, range: impl RangeBounds<$t>) -> $t {
+ let panic_empty_range = || {
+ panic!(
+ "empty range: {:?}..{:?}",
+ range.start_bound(),
+ range.end_bound()
+ )
+ };
+
+ let low = match range.start_bound() {
+ Bound::Unbounded => std::$t::MIN,
+ Bound::Included(&x) => x,
+ Bound::Excluded(&x) => x.checked_add(1).unwrap_or_else(panic_empty_range),
+ };
+
+ let high = match range.end_bound() {
+ Bound::Unbounded => std::$t::MAX,
+ Bound::Included(&x) => x,
+ Bound::Excluded(&x) => x.checked_sub(1).unwrap_or_else(panic_empty_range),
+ };
+
+ if low > high {
+ panic_empty_range();
+ }
+
+ if low == std::$t::MIN && high == std::$t::MAX {
+ self.$gen() as $t
+ } else {
+ let len = high.wrapping_sub(low).wrapping_add(1);
+ low.wrapping_add(self.$mod(len as $unsigned_t as _) as $t)
+ }
+ }
+ };
+}
+
+impl Rng {
+ /// Creates a new random number generator.
+ #[inline]
+ pub fn new() -> Rng {
+ Rng::with_seed(
+ RNG.try_with(|rng| rng.u64(..))
+ .unwrap_or(0x4d595df4d0f33173),
+ )
+ }
+
+ /// Creates a new random number generator with the initial seed.
+ #[inline]
+ pub fn with_seed(seed: u64) -> Self {
+ let rng = Rng(Cell::new(0));
+
+ rng.seed(seed);
+ rng
+ }
+
+ /// Generates a random `char` in ranges a-z and A-Z.
+ #[inline]
+ pub fn alphabetic(&self) -> char {
+ const CHARS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ let len = CHARS.len() as u8;
+ let i = self.u8(..len);
+ CHARS[i as usize] as char
+ }
+
+ /// Generates a random `char` in ranges a-z, A-Z and 0-9.
+ #[inline]
+ pub fn alphanumeric(&self) -> char {
+ const CHARS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+ let len = CHARS.len() as u8;
+ let i = self.u8(..len);
+ CHARS[i as usize] as char
+ }
+
+ /// Generates a random `bool`.
+ #[inline]
+ pub fn bool(&self) -> bool {
+ self.u8(..) % 2 == 0
+ }
+
+ /// Generates a random digit in the given `base`.
+ ///
+ /// Digits are represented by `char`s in ranges 0-9 and a-z.
+ ///
+ /// Panics if the base is zero or greater than 36.
+ #[inline]
+ pub fn digit(&self, base: u32) -> char {
+ if base == 0 {
+ panic!("base cannot be zero");
+ }
+ if base > 36 {
+ panic!("base cannot be larger than 36");
+ }
+ let num = self.u8(..base as u8);
+ if num < 10 {
+ (b'0' + num) as char
+ } else {
+ (b'a' + num - 10) as char
+ }
+ }
+
+ /// Generates a random `f32` in range `0..1`.
+ pub fn f32(&self) -> f32 {
+ let b = 32;
+ let f = std::f32::MANTISSA_DIGITS - 1;
+ f32::from_bits((1 << (b - 2)) - (1 << f) + (self.u32(..) >> (b - f))) - 1.0
+ }
+
+ /// Generates a random `f64` in range `0..1`.
+ pub fn f64(&self) -> f64 {
+ let b = 64;
+ let f = std::f64::MANTISSA_DIGITS - 1;
+ f64::from_bits((1 << (b - 2)) - (1 << f) + (self.u64(..) >> (b - f))) - 1.0
+ }
+
+ rng_integer!(
+ i8,
+ u8,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `i8` in the given range."
+ );
+
+ rng_integer!(
+ i16,
+ u16,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `i16` in the given range."
+ );
+
+ rng_integer!(
+ i32,
+ u32,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `i32` in the given range."
+ );
+
+ rng_integer!(
+ i64,
+ u64,
+ gen_u64,
+ gen_mod_u64,
+ "Generates a random `i64` in the given range."
+ );
+
+ rng_integer!(
+ i128,
+ u128,
+ gen_u128,
+ gen_mod_u128,
+ "Generates a random `i128` in the given range."
+ );
+
+ #[cfg(target_pointer_width = "16")]
+ rng_integer!(
+ isize,
+ usize,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `isize` in the given range."
+ );
+ #[cfg(target_pointer_width = "32")]
+ rng_integer!(
+ isize,
+ usize,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `isize` in the given range."
+ );
+ #[cfg(target_pointer_width = "64")]
+ rng_integer!(
+ isize,
+ usize,
+ gen_u64,
+ gen_mod_u64,
+ "Generates a random `isize` in the given range."
+ );
+
+ /// Generates a random `char` in range a-z.
+ #[inline]
+ pub fn lowercase(&self) -> char {
+ const CHARS: &[u8] = b"abcdefghijklmnopqrstuvwxyz";
+ let len = CHARS.len() as u8;
+ let i = self.u8(..len);
+ CHARS[i as usize] as char
+ }
+
+ /// Initializes this generator with the given seed.
+ #[inline]
+ pub fn seed(&self, seed: u64) {
+ self.0.set(seed);
+ }
+
+ /// Shuffles a slice randomly.
+ #[inline]
+ pub fn shuffle(&self, slice: &mut [T]) {
+ for i in 1..slice.len() {
+ slice.swap(i, self.usize(..=i));
+ }
+ }
+
+ rng_integer!(
+ u8,
+ u8,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `u8` in the given range."
+ );
+
+ rng_integer!(
+ u16,
+ u16,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `u16` in the given range."
+ );
+
+ rng_integer!(
+ u32,
+ u32,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `u32` in the given range."
+ );
+
+ rng_integer!(
+ u64,
+ u64,
+ gen_u64,
+ gen_mod_u64,
+ "Generates a random `u64` in the given range."
+ );
+
+ rng_integer!(
+ u128,
+ u128,
+ gen_u128,
+ gen_mod_u128,
+ "Generates a random `u128` in the given range."
+ );
+
+ #[cfg(target_pointer_width = "16")]
+ rng_integer!(
+ usize,
+ usize,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `usize` in the given range."
+ );
+ #[cfg(target_pointer_width = "32")]
+ rng_integer!(
+ usize,
+ usize,
+ gen_u32,
+ gen_mod_u32,
+ "Generates a random `usize` in the given range."
+ );
+ #[cfg(target_pointer_width = "64")]
+ rng_integer!(
+ usize,
+ usize,
+ gen_u64,
+ gen_mod_u64,
+ "Generates a random `usize` in the given range."
+ );
+ #[cfg(target_pointer_width = "128")]
+ rng_integer!(
+ usize,
+ usize,
+ gen_u128,
+ gen_mod_u128,
+ "Generates a random `usize` in the given range."
+ );
+
+ /// Generates a random `char` in range A-Z.
+ #[inline]
+ pub fn uppercase(&self) -> char {
+ const CHARS: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ let len = CHARS.len() as u8;
+ let i = self.u8(..len);
+ CHARS[i as usize] as char
+ }
+
+ /// Generates a random `char` in the given range.
+ ///
+ /// Panics if the range is empty.
+ #[inline]
+ pub fn char(&self, range: impl RangeBounds) -> char {
+ use std::convert::{TryFrom, TryInto};
+
+ let panic_empty_range = || {
+ panic!(
+ "empty range: {:?}..{:?}",
+ range.start_bound(),
+ range.end_bound()
+ )
+ };
+
+ let surrogate_start = 0xd800u32;
+ let surrogate_len = 0x800u32;
+
+ let low = match range.start_bound() {
+ Bound::Unbounded => 0u8 as char,
+ Bound::Included(&x) => x,
+ Bound::Excluded(&x) => {
+ let scalar = if x as u32 == surrogate_start - 1 {
+ surrogate_start + surrogate_len
+ } else {
+ x as u32 + 1
+ };
+ char::try_from(scalar).unwrap_or_else(|_| panic_empty_range())
+ }
+ };
+
+ let high = match range.end_bound() {
+ Bound::Unbounded => std::char::MAX,
+ Bound::Included(&x) => x,
+ Bound::Excluded(&x) => {
+ let scalar = if x as u32 == surrogate_start + surrogate_len {
+ surrogate_start - 1
+ } else {
+ (x as u32).wrapping_sub(1)
+ };
+ char::try_from(scalar).unwrap_or_else(|_| panic_empty_range())
+ }
+ };
+
+ if low > high {
+ panic_empty_range();
+ }
+
+ let gap = if (low as u32) < surrogate_start && (high as u32) >= surrogate_start {
+ surrogate_len
+ } else {
+ 0
+ };
+ let range = high as u32 - low as u32 - gap;
+ let mut val = self.u32(0..=range) + low as u32;
+ if val >= surrogate_start {
+ val += gap;
+ }
+ val.try_into().unwrap()
+ }
+}
+
+/// Initializes the thread-local generator with the given seed.
+#[inline]
+pub fn seed(seed: u64) {
+ RNG.with(|rng| rng.seed(seed))
+}
+
+/// Generates a random `bool`.
+#[inline]
+pub fn bool() -> bool {
+ RNG.with(|rng| rng.bool())
+}
+
+/// Generates a random `char` in ranges a-z and A-Z.
+#[inline]
+pub fn alphabetic() -> char {
+ RNG.with(|rng| rng.alphabetic())
+}
+
+/// Generates a random `char` in ranges a-z, A-Z and 0-9.
+#[inline]
+pub fn alphanumeric() -> char {
+ RNG.with(|rng| rng.alphanumeric())
+}
+
+/// Generates a random `char` in range a-z.
+#[inline]
+pub fn lowercase() -> char {
+ RNG.with(|rng| rng.lowercase())
+}
+
+/// Generates a random `char` in range A-Z.
+#[inline]
+pub fn uppercase() -> char {
+ RNG.with(|rng| rng.uppercase())
+}
+
+/// Generates a random digit in the given `base`.
+///
+/// Digits are represented by `char`s in ranges 0-9 and a-z.
+///
+/// Panics if the base is zero or greater than 36.
+#[inline]
+pub fn digit(base: u32) -> char {
+ RNG.with(|rng| rng.digit(base))
+}
+
+/// Shuffles a slice randomly.
+#[inline]
+pub fn shuffle(slice: &mut [T]) {
+ RNG.with(|rng| rng.shuffle(slice))
+}
+
+macro_rules! integer {
+ ($t:tt, $doc:tt) => {
+ #[doc = $doc]
+ ///
+ /// Panics if the range is empty.
+ #[inline]
+ pub fn $t(range: impl RangeBounds<$t>) -> $t {
+ RNG.with(|rng| rng.$t(range))
+ }
+ };
+}
+
+integer!(u8, "Generates a random `u8` in the given range.");
+integer!(i8, "Generates a random `i8` in the given range.");
+integer!(u16, "Generates a random `u16` in the given range.");
+integer!(i16, "Generates a random `i16` in the given range.");
+integer!(u32, "Generates a random `u32` in the given range.");
+integer!(i32, "Generates a random `i32` in the given range.");
+integer!(u64, "Generates a random `u64` in the given range.");
+integer!(i64, "Generates a random `i64` in the given range.");
+integer!(u128, "Generates a random `u128` in the given range.");
+integer!(i128, "Generates a random `i128` in the given range.");
+integer!(usize, "Generates a random `usize` in the given range.");
+integer!(isize, "Generates a random `isize` in the given range.");
+integer!(char, "Generates a random `char` in the given range.");
+
+/// Generates a random `f32` in range `0..1`.
+pub fn f32() -> f32 {
+ RNG.with(|rng| rng.f32())
+}
+
+/// Generates a random `f64` in range `0..1`.
+pub fn f64() -> f64 {
+ RNG.with(|rng| rng.f64())
+}
diff -Nru cargo-0.58.0/vendor/fastrand/tests/char.rs cargo-0.60.0ubuntu1/vendor/fastrand/tests/char.rs
--- cargo-0.58.0/vendor/fastrand/tests/char.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/tests/char.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,44 @@
+use std::convert::TryFrom;
+use std::ops::RangeBounds;
+
+fn test_char_coverage(n: usize, range: R)
+where
+ R: Iterator + RangeBounds + Clone,
+{
+ use std::collections::HashSet;
+
+ let all: HashSet = range.clone().collect();
+ let mut covered = HashSet::new();
+ for _ in 0..n {
+ let c = fastrand::char(range.clone());
+ assert!(all.contains(&c));
+ covered.insert(c);
+ }
+ assert_eq!(covered, all);
+}
+
+#[test]
+fn test_char() {
+ // ASCII control chars.
+ let nul = 0u8 as char;
+ let soh = 1u8 as char;
+ let stx = 2u8 as char;
+ // Some undefined Hangul Jamo codepoints just before
+ // the surrogate area.
+ let last_jamo = char::try_from(0xd7ffu32).unwrap();
+ let penultimate_jamo = char::try_from(last_jamo as u32 - 1).unwrap();
+ // Private-use codepoints just after the surrogate area.
+ let first_private = char::try_from(0xe000u32).unwrap();
+ let second_private = char::try_from(first_private as u32 + 1).unwrap();
+ // Private-use codepoints at the end of Unicode space.
+ let last_private = std::char::MAX;
+ let penultimate_private = char::try_from(last_private as u32 - 1).unwrap();
+
+ test_char_coverage(100, nul..stx);
+ test_char_coverage(100, nul..=soh);
+
+ test_char_coverage(400, penultimate_jamo..second_private);
+ test_char_coverage(400, penultimate_jamo..=second_private);
+
+ test_char_coverage(100, penultimate_private..=last_private);
+}
diff -Nru cargo-0.58.0/vendor/fastrand/tests/smoke.rs cargo-0.60.0ubuntu1/vendor/fastrand/tests/smoke.rs
--- cargo-0.58.0/vendor/fastrand/tests/smoke.rs 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/fastrand/tests/smoke.rs 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,117 @@
+#[cfg(target_arch = "wasm32")]
+use wasm_bindgen_test::*;
+
+#[cfg(target_arch = "wasm32")]
+wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn bool() {
+ for x in &[false, true] {
+ while fastrand::bool() != *x {}
+ }
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn u8() {
+ for x in 0..10 {
+ while fastrand::u8(..10) != x {}
+ }
+
+ for x in 200..=u8::MAX {
+ while fastrand::u8(200..) != x {}
+ }
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn i8() {
+ for x in -128..-120 {
+ while fastrand::i8(..-120) != x {}
+ }
+
+ for x in 120..=127 {
+ while fastrand::i8(120..) != x {}
+ }
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn u32() {
+ for n in 1u32..10_000 {
+ let n = n.wrapping_mul(n);
+ let n = n.wrapping_mul(n);
+ if n != 0 {
+ for _ in 0..1000 {
+ assert!(fastrand::u32(..n) < n);
+ }
+ }
+ }
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn u64() {
+ for n in 1u64..10_000 {
+ let n = n.wrapping_mul(n);
+ let n = n.wrapping_mul(n);
+ let n = n.wrapping_mul(n);
+ if n != 0 {
+ for _ in 0..1000 {
+ assert!(fastrand::u64(..n) < n);
+ }
+ }
+ }
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn u128() {
+ for n in 1u128..10_000 {
+ let n = n.wrapping_mul(n);
+ let n = n.wrapping_mul(n);
+ let n = n.wrapping_mul(n);
+ let n = n.wrapping_mul(n);
+ if n != 0 {
+ for _ in 0..1000 {
+ assert!(fastrand::u128(..n) < n);
+ }
+ }
+ }
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn rng() {
+ let r = fastrand::Rng::new();
+
+ assert_ne!(r.u64(..), r.u64(..));
+
+ r.seed(7);
+ let a = r.u64(..);
+ r.seed(7);
+ let b = r.u64(..);
+ assert_eq!(a, b);
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn rng_init() {
+ let a = fastrand::Rng::new();
+ let b = fastrand::Rng::new();
+ assert_ne!(a.u64(..), b.u64(..));
+
+ a.seed(7);
+ b.seed(7);
+ assert_eq!(a.u64(..), b.u64(..));
+}
+
+#[test]
+#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
+fn with_seed() {
+ let a = fastrand::Rng::with_seed(7);
+ let b = fastrand::Rng::new();
+ b.seed(7);
+ assert_eq!(a.u64(..), b.u64(..));
+}
diff -Nru cargo-0.58.0/vendor/filetime/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/filetime/.cargo-checksum.json
--- cargo-0.58.0/vendor/filetime/.cargo-checksum.json 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/filetime/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98"}
\ No newline at end of file
+{"files":{},"package":"c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/filetime/Cargo.toml cargo-0.60.0ubuntu1/vendor/filetime/Cargo.toml
--- cargo-0.58.0/vendor/filetime/Cargo.toml 2022-01-21 02:47:39.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/filetime/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -3,33 +3,46 @@
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
-# to registry (e.g., crates.io) dependencies
+# to registry (e.g., crates.io) dependencies.
#
-# If you believe there's an error in this file please file an
-# issue against the rust-lang/cargo repository. If you're
-# editing this file be aware that the upstream Cargo.toml
-# will likely look very different (and much more reasonable)
+# If you are reading this file be aware that the original Cargo.toml
+# will likely look very different (and much more reasonable).
+# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "filetime"
-version = "0.2.15"
+version = "0.2.16"
authors = ["Alex Crichton "]
-description = "Platform-agnostic accessors of timestamps in File metadata\n"
+description = """
+Platform-agnostic accessors of timestamps in File metadata
+"""
homepage = "https://github.com/alexcrichton/filetime"
documentation = "https://docs.rs/filetime"
readme = "README.md"
-keywords = ["timestamp", "mtime"]
+keywords = [
+ "timestamp",
+ "mtime",
+]
license = "MIT/Apache-2.0"
repository = "https://github.com/alexcrichton/filetime"
+
[dependencies.cfg-if]
version = "1.0.0"
+
[dev-dependencies.tempfile]
version = "3"
+
[target."cfg(target_os = \"redox\")".dependencies.redox_syscall]
version = "0.2.9"
+
[target."cfg(unix)".dependencies.libc]
version = "0.2.27"
+
[target."cfg(windows)".dependencies.winapi]
version = "0.3"
-features = ["fileapi", "minwindef", "winbase"]
+features = [
+ "fileapi",
+ "minwindef",
+ "winbase",
+]
diff -Nru cargo-0.58.0/vendor/filetime/src/lib.rs cargo-0.60.0ubuntu1/vendor/filetime/src/lib.rs
--- cargo-0.58.0/vendor/filetime/src/lib.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/filetime/src/lib.rs 2022-04-20 13:48:09.000000000 +0000
@@ -71,14 +71,14 @@
/// Creates a new timestamp representing a 0 time.
///
/// Useful for creating the base of a cmp::max chain of times.
- pub fn zero() -> FileTime {
+ pub const fn zero() -> FileTime {
FileTime {
seconds: 0,
nanos: 0,
}
}
- fn emulate_second_only_system(self) -> FileTime {
+ const fn emulate_second_only_system(self) -> FileTime {
if cfg!(emulate_second_only_system) {
FileTime {
seconds: self.seconds,
@@ -118,7 +118,7 @@
/// from, but on Windows the native time stamp is relative to January 1,
/// 1601 so the return value of `seconds` from the returned `FileTime`
/// instance may not be the same as that passed in.
- pub fn from_unix_time(seconds: i64, nanos: u32) -> FileTime {
+ pub const fn from_unix_time(seconds: i64, nanos: u32) -> FileTime {
FileTime {
seconds: seconds + if cfg!(windows) { 11644473600 } else { 0 },
nanos,
@@ -193,7 +193,7 @@
/// Note that this value's meaning is **platform specific**. On Unix
/// platform time stamps are typically relative to January 1, 1970, but on
/// Windows platforms time stamps are relative to January 1, 1601.
- pub fn seconds(&self) -> i64 {
+ pub const fn seconds(&self) -> i64 {
self.seconds
}
@@ -202,7 +202,7 @@
///
/// Note that this does not return the same value as `seconds` for Windows
/// platforms as seconds are relative to a different date there.
- pub fn unix_seconds(&self) -> i64 {
+ pub const fn unix_seconds(&self) -> i64 {
self.seconds - if cfg!(windows) { 11644473600 } else { 0 }
}
@@ -211,7 +211,7 @@
/// The returned value is always less than one billion and represents a
/// portion of a second forward from the seconds returned by the `seconds`
/// method.
- pub fn nanoseconds(&self) -> u32 {
+ pub const fn nanoseconds(&self) -> u32 {
self.nanos
}
}
@@ -630,7 +630,7 @@
fn set_symlink_dir_times_test() {
let td = Builder::new().prefix("filetime").tempdir().unwrap();
let path = td.path().join("foo");
- fs::create_dir(&path);
+ fs::create_dir(&path).unwrap();
let metadata = fs::metadata(&path).unwrap();
let mtime = FileTime::from_last_modification_time(&metadata);
diff -Nru cargo-0.58.0/vendor/filetime/src/unix/android.rs cargo-0.60.0ubuntu1/vendor/filetime/src/unix/android.rs
--- cargo-0.58.0/vendor/filetime/src/unix/android.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/filetime/src/unix/android.rs 2022-04-20 13:48:09.000000000 +0000
@@ -37,7 +37,7 @@
}
pub fn set_symlink_file_times(p: &Path, atime: FileTime, mtime: FileTime) -> io::Result<()> {
- set_times(p, Some(atime), Some(mtime), false)
+ set_times(p, Some(atime), Some(mtime), true)
}
fn set_times(
diff -Nru cargo-0.58.0/vendor/filetime/src/unix/utimes.rs cargo-0.60.0ubuntu1/vendor/filetime/src/unix/utimes.rs
--- cargo-0.58.0/vendor/filetime/src/unix/utimes.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/filetime/src/unix/utimes.rs 2022-04-20 13:48:09.000000000 +0000
@@ -118,6 +118,7 @@
}
}
+#[cfg(target_env = "uclibc")]
fn to_timespec(ft: &FileTime) -> libc::timespec {
libc::timespec {
tv_sec: ft.seconds() as libc::time_t,
diff -Nru cargo-0.58.0/vendor/flate2/.cargo-checksum.json cargo-0.60.0ubuntu1/vendor/flate2/.cargo-checksum.json
--- cargo-0.58.0/vendor/flate2/.cargo-checksum.json 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/.cargo-checksum.json 2022-04-20 13:48:09.000000000 +0000
@@ -1 +1 @@
-{"files":{},"package":"1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f"}
\ No newline at end of file
+{"files":{},"package":"b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"}
\ No newline at end of file
diff -Nru cargo-0.58.0/vendor/flate2/Cargo.lock cargo-0.60.0ubuntu1/vendor/flate2/Cargo.lock
--- cargo-0.58.0/vendor/flate2/Cargo.lock 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/Cargo.lock 2022-04-20 13:48:09.000000000 +0000
@@ -4,49 +4,15 @@
[[package]]
name = "adler"
-version = "0.2.3"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e"
-
-[[package]]
-name = "autocfg"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
-
-[[package]]
-name = "bitflags"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
-
-[[package]]
-name = "byteorder"
-version = "1.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
-
-[[package]]
-name = "bytes"
-version = "0.4.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
-dependencies = [
- "byteorder",
- "iovec",
-]
+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "cc"
-version = "1.0.67"
+version = "1.0.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e3c69b077ad434294d3ce9f1f6143a2a4b89a8a2d54ef813d85003a4fd1137fd"
-
-[[package]]
-name = "cfg-if"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11"
[[package]]
name = "cfg-if"
@@ -55,15 +21,6 @@
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
-name = "cloudabi"
-version = "0.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
name = "cloudflare-zlib-sys"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -74,173 +31,59 @@
[[package]]
name = "cmake"
-version = "0.1.45"
+version = "0.1.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855"
+checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a"
dependencies = [
"cc",
]
[[package]]
name = "crc32fast"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
-dependencies = [
- "cfg-if 1.0.0",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.7.3"
+version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"
+checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
- "crossbeam-epoch",
- "crossbeam-utils",
- "maybe-uninit",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.8.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
-dependencies = [
- "autocfg",
- "cfg-if 0.1.10",
- "crossbeam-utils",
- "lazy_static",
- "maybe-uninit",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-queue"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
-dependencies = [
- "cfg-if 0.1.10",
- "crossbeam-utils",
- "maybe-uninit",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
-dependencies = [
- "autocfg",
- "cfg-if 0.1.10",
- "lazy_static",
+ "cfg-if",
]
[[package]]
name = "flate2"
-version = "1.0.22"
+version = "1.0.23"
dependencies = [
- "cfg-if 1.0.0",
+ "cfg-if",
"cloudflare-zlib-sys",
"crc32fast",
- "futures",
"libc",
"libz-sys",
"miniz-sys",
"miniz_oxide",
"quickcheck",
"rand",
- "tokio-io",
- "tokio-tcp",
- "tokio-threadpool",
]
[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "fuchsia-zircon"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
-dependencies = [
- "bitflags",
- "fuchsia-zircon-sys",
-]
-
-[[package]]
-name = "fuchsia-zircon-sys"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
-
-[[package]]
-name = "futures"
-version = "0.1.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4c7e4c2612746b0df8fed4ce0c69156021b704c9aefa360311c04e6e9e002eed"
-
-[[package]]
name = "getrandom"
-version = "0.1.15"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6"
+checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad"
dependencies = [
- "cfg-if 0.1.10",
+ "cfg-if",
"libc",
"wasi",
]
[[package]]
-name = "hermit-abi"
-version = "0.1.17"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "iovec"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "kernel32-sys"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
-dependencies = [
- "winapi 0.2.8",
- "winapi-build",
-]
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
name = "libc"
-version = "0.2.81"
+version = "0.2.122"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb"
+checksum = "ec647867e2bf0772e28c8bcde4f0d19a9216916e890543b5a03ed8ef27b8f259"
[[package]]
name = "libz-sys"
-version = "1.1.2"
+version = "1.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655"
+checksum = "6f35facd4a5673cb5a48822be2be1d4236c1c99cb4113cab7061ac720d5bf859"
dependencies = [
"cc",
"cmake",
@@ -250,39 +93,6 @@
]
[[package]]
-name = "lock_api"
-version = "0.3.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75"
-dependencies = [
- "scopeguard",
-]
-
-[[package]]
-name = "log"
-version = "0.4.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
-dependencies = [
- "cfg-if 0.1.10",
-]
-
-[[package]]
-name = "maybe-uninit"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
-
-[[package]]
-name = "memoffset"
-version = "0.5.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
name = "miniz-sys"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -294,132 +104,50 @@
[[package]]
name = "miniz_oxide"
-version = "0.4.3"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d"
+checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
dependencies = [
"adler",
- "autocfg",
-]
-
-[[package]]
-name = "mio"
-version = "0.6.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4"
-dependencies = [
- "cfg-if 0.1.10",
- "fuchsia-zircon",
- "fuchsia-zircon-sys",
- "iovec",
- "kernel32-sys",
- "libc",
- "log",
- "miow",
- "net2",
- "slab",
- "winapi 0.2.8",
-]
-
-[[package]]
-name = "miow"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d"
-dependencies = [
- "kernel32-sys",
- "net2",
- "winapi 0.2.8",
- "ws2_32-sys",
-]
-
-[[package]]
-name = "net2"
-version = "0.2.37"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae"
-dependencies = [
- "cfg-if 0.1.10",
- "libc",
- "winapi 0.3.9",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "parking_lot"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
-dependencies = [
- "lock_api",
- "parking_lot_core",
- "rustc_version",
-]
-
-[[package]]
-name = "parking_lot_core"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
-dependencies = [
- "cfg-if 0.1.10",
- "cloudabi",
- "libc",
- "redox_syscall",
- "rustc_version",
- "smallvec",
- "winapi 0.3.9",
]
[[package]]
name = "pkg-config"
-version = "0.3.19"
+version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
+checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
[[package]]
name = "ppv-lite86"
-version = "0.2.10"
+version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
[[package]]
name = "quickcheck"
-version = "0.9.2"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a44883e74aa97ad63db83c4bf8ca490f02b2fc02f92575e720c8551e843c945f"
+checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
dependencies = [
"rand",
- "rand_core",
]
[[package]]
name = "rand"
-version = "0.7.3"
+version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
dependencies = [
- "getrandom",
"libc",
"rand_chacha",
"rand_core",
- "rand_hc",
]
[[package]]
name = "rand_chacha"
-version = "0.2.2"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
dependencies = [
"ppv-lite86",
"rand_core",
@@ -427,206 +155,21 @@
[[package]]
name = "rand_core"
-version = "0.5.1"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19"
+checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
dependencies = [
"getrandom",
]
[[package]]
-name = "rand_hc"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
-dependencies = [
- "rand_core",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.1.57"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
-
-[[package]]
-name = "rustc_version"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "semver"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
-dependencies = [
- "semver-parser",
-]
-
-[[package]]
-name = "semver-parser"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
-
-[[package]]
-name = "slab"
-version = "0.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8"
-
-[[package]]
-name = "smallvec"
-version = "0.6.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
-dependencies = [
- "maybe-uninit",
-]
-
-[[package]]
-name = "tokio-executor"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671"
-dependencies = [
- "crossbeam-utils",
- "futures",
-]
-
-[[package]]
-name = "tokio-io"
-version = "0.1.13"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
-dependencies = [
- "bytes",
- "futures",
- "log",
-]
-
-[[package]]
-name = "tokio-reactor"
-version = "0.1.12"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351"
-dependencies = [
- "crossbeam-utils",
- "futures",
- "lazy_static",
- "log",
- "mio",
- "num_cpus",
- "parking_lot",
- "slab",
- "tokio-executor",
- "tokio-io",
- "tokio-sync",
-]
-
-[[package]]
-name = "tokio-sync"
-version = "0.1.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee"
-dependencies = [
- "fnv",
- "futures",
-]
-
-[[package]]
-name = "tokio-tcp"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72"
-dependencies = [
- "bytes",
- "futures",
- "iovec",
- "mio",
- "tokio-io",
- "tokio-reactor",
-]
-
-[[package]]
-name = "tokio-threadpool"
-version = "0.1.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89"
-dependencies = [
- "crossbeam-deque",
- "crossbeam-queue",
- "crossbeam-utils",
- "futures",
- "lazy_static",
- "log",
- "num_cpus",
- "slab",
- "tokio-executor",
-]
-
-[[package]]
name = "vcpkg"
-version = "0.2.11"
+version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]]
name = "wasi"
-version = "0.9.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
-
-[[package]]
-name = "winapi"
-version = "0.2.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
+version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-build"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "ws2_32-sys"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e"
-dependencies = [
- "winapi 0.2.8",
- "winapi-build",
-]
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
diff -Nru cargo-0.58.0/vendor/flate2/Cargo.toml cargo-0.60.0ubuntu1/vendor/flate2/Cargo.toml
--- cargo-0.58.0/vendor/flate2/Cargo.toml 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/Cargo.toml 2022-04-20 13:48:09.000000000 +0000
@@ -12,7 +12,7 @@
[package]
edition = "2018"
name = "flate2"
-version = "1.0.22"
+version = "1.0.23"
authors = ["Alex Crichton ", "Josh Triplett "]
description = "DEFLATE compression and decompression exposed as Read/BufRead/Write streams.\nSupports miniz_oxide, miniz.c, and multiple zlib implementations. Supports\nzlib, gzip, and raw deflate streams.\n"
homepage = "https://github.com/rust-lang/flate2-rs"
@@ -37,16 +37,15 @@
default-features = false
[dependencies.miniz_oxide]
-version = "0.4.0"
+version = "0.5.0"
optional = true
default-features = false
-
[dev-dependencies.quickcheck]
-version = "0.9"
+version = "1.0"
default-features = false
[dev-dependencies.rand]
-version = "0.7"
+version = "0.8"
[features]
default = ["rust_backend"]
@@ -54,5 +53,5 @@
miniz-sys = ["zlib"]
zlib = ["libz-sys"]
[target."cfg(all(target_arch = \"wasm32\", not(target_os = \"emscripten\")))".dependencies.miniz_oxide]
-version = "0.4.0"
+version = "0.5.0"
default-features = false
diff -Nru cargo-0.58.0/vendor/flate2/debian/patches/disable-miniz.patch cargo-0.60.0ubuntu1/vendor/flate2/debian/patches/disable-miniz.patch
--- cargo-0.58.0/vendor/flate2/debian/patches/disable-miniz.patch 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/debian/patches/disable-miniz.patch 2022-04-20 13:48:09.000000000 +0000
@@ -18,6 +18,6 @@
default = ["rust_backend"]
rust_backend = ["miniz_oxide"]
+miniz-sys = ["zlib"]
- tokio = ["tokio-io", "futures"]
zlib = ["any_zlib", "libz-sys"]
zlib-ng-compat = ["zlib", "libz-sys/zlib-ng"]
+ [target."cfg(all(target_arch = \"wasm32\", not(target_os = \"emscripten\")))".dependencies.miniz_oxide]
diff -Nru cargo-0.58.0/vendor/flate2/debian/patches/disable-miniz.patch.orig cargo-0.60.0ubuntu1/vendor/flate2/debian/patches/disable-miniz.patch.orig
--- cargo-0.58.0/vendor/flate2/debian/patches/disable-miniz.patch.orig 1970-01-01 00:00:00.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/debian/patches/disable-miniz.patch.orig 2022-04-20 13:48:09.000000000 +0000
@@ -0,0 +1,23 @@
+Index: flate2/Cargo.toml
+===================================================================
+--- flate2.orig/Cargo.toml
++++ flate2/Cargo.toml
+@@ -44,10 +44,6 @@ version = "1.1.0"
+ optional = true
+ default-features = false
+
+-[dependencies.miniz-sys]
+-version = "0.1.11"
+-optional = true
+-
+ [dependencies.miniz_oxide]
+ version = "0.4.0"
+ optional = true
+@@ -80,6 +76,7 @@ any_zlib = []
+ cloudflare_zlib = ["any_zlib", "cloudflare-zlib-sys"]
+ default = ["rust_backend"]
+ rust_backend = ["miniz_oxide"]
++miniz-sys = ["zlib"]
+ tokio = ["tokio-io", "futures"]
+ zlib = ["any_zlib", "libz-sys"]
+ zlib-ng-compat = ["zlib", "libz-sys/zlib-ng"]
diff -Nru cargo-0.58.0/vendor/flate2/debian/patches/series cargo-0.60.0ubuntu1/vendor/flate2/debian/patches/series
--- cargo-0.58.0/vendor/flate2/debian/patches/series 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/debian/patches/series 2022-04-20 13:48:09.000000000 +0000
@@ -1,5 +1,4 @@
disable-miniz.patch
-remove-futures-and-tokio.patch
disable-cloudflare-zlib.patch
disable-zlib-ng.patch
eliminate-any-zlib.patch
diff -Nru cargo-0.58.0/vendor/flate2/examples/deflateencoder-read.rs cargo-0.60.0ubuntu1/vendor/flate2/examples/deflateencoder-read.rs
--- cargo-0.58.0/vendor/flate2/examples/deflateencoder-read.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/examples/deflateencoder-read.rs 2022-04-20 13:48:09.000000000 +0000
@@ -10,7 +10,7 @@
println!("{:?}", deflateencoder_read_hello_world().unwrap());
}
-// Return a vector containing the Defalte compressed version of hello world
+// Return a vector containing the Deflate compressed version of hello world
fn deflateencoder_read_hello_world() -> io::Result> {
let mut result = Vec::new();
let c = b"hello world";
diff -Nru cargo-0.58.0/vendor/flate2/examples/gzbuilder.rs cargo-0.60.0ubuntu1/vendor/flate2/examples/gzbuilder.rs
--- cargo-0.58.0/vendor/flate2/examples/gzbuilder.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/examples/gzbuilder.rs 2022-04-20 13:48:09.000000000 +0000
@@ -6,14 +6,14 @@
use std::io;
use std::io::prelude::*;
-// Open file and debug print the contents compressed with gzip
+// Compresses content of a text file into a gzip file
fn main() {
sample_builder().unwrap();
}
// GzBuilder opens a file and writes a sample string using Builder pattern
fn sample_builder() -> Result<(), io::Error> {
- let f = File::create("examples/hello_world.gz")?;
+ let f = File::create("examples/hello_world.txt.gz")?;
let mut gz = GzBuilder::new()
.filename("hello_world.txt")
.comment("test file, please delete")
diff -Nru cargo-0.58.0/vendor/flate2/examples/gzdecoder-bufread.rs cargo-0.60.0ubuntu1/vendor/flate2/examples/gzdecoder-bufread.rs
--- cargo-0.58.0/vendor/flate2/examples/gzdecoder-bufread.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/examples/gzdecoder-bufread.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,8 +1,7 @@
extern crate flate2;
-use flate2::bufread::GzDecoder;
use flate2::write::GzEncoder;
-use flate2::Compression;
+use flate2::{bufread, Compression};
use std::io;
use std::io::prelude::*;
@@ -17,7 +16,7 @@
// Uncompresses a Gz Encoded vector of bytes and returns a string or error
// Here &[u8] implements BufRead
fn decode_reader(bytes: Vec) -> io::Result {
- let mut gz = GzDecoder::new(&bytes[..]);
+ let mut gz = bufread::GzDecoder::new(&bytes[..]);
let mut s = String::new();
gz.read_to_string(&mut s)?;
Ok(s)
diff -Nru cargo-0.58.0/vendor/flate2/examples/gzdecoder-read.rs cargo-0.60.0ubuntu1/vendor/flate2/examples/gzdecoder-read.rs
--- cargo-0.58.0/vendor/flate2/examples/gzdecoder-read.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/examples/gzdecoder-read.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,8 +1,7 @@
extern crate flate2;
-use flate2::read::GzDecoder;
use flate2::write::GzEncoder;
-use flate2::Compression;
+use flate2::{read, Compression};
use std::io;
use std::io::prelude::*;
@@ -17,7 +16,7 @@
// Uncompresses a Gz Encoded vector of bytes and returns a string or error
// Here &[u8] implements Read
fn decode_reader(bytes: Vec) -> io::Result {
- let mut gz = GzDecoder::new(&bytes[..]);
+ let mut gz = read::GzDecoder::new(&bytes[..]);
let mut s = String::new();
gz.read_to_string(&mut s)?;
Ok(s)
diff -Nru cargo-0.58.0/vendor/flate2/README.md cargo-0.60.0ubuntu1/vendor/flate2/README.md
--- cargo-0.58.0/vendor/flate2/README.md 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/README.md 2022-04-20 13:48:09.000000000 +0000
@@ -77,7 +77,7 @@
For compatibility with previous versions of `flate2`, the cloudflare optimized
version of zlib is available, via the `cloudflare_zlib` feature. It's not as
-fast as zlib-ng, but it's faster than stock zlib. It requires a x86-64 CPU with
+fast as zlib-ng, but it's faster than stock zlib. It requires an x86-64 CPU with
SSE 4.2 or ARM64 with NEON & CRC. It does not support 32-bit CPUs at all and is
incompatible with mingw. For more information check the [crate
documentation](https://crates.io/crates/cloudflare-zlib-sys). Note that
diff -Nru cargo-0.58.0/vendor/flate2/src/bufreader.rs cargo-0.60.0ubuntu1/vendor/flate2/src/bufreader.rs
--- cargo-0.58.0/vendor/flate2/src/bufreader.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/bufreader.rs 2022-04-20 13:48:09.000000000 +0000
@@ -42,7 +42,7 @@
pub fn with_buf(buf: Vec, inner: R) -> BufReader {
BufReader {
- inner: inner,
+ inner,
buf: buf.into_boxed_slice(),
pos: 0,
cap: 0,
diff -Nru cargo-0.58.0/vendor/flate2/src/crc.rs cargo-0.60.0ubuntu1/vendor/flate2/src/crc.rs
--- cargo-0.58.0/vendor/flate2/src/crc.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/crc.rs 2022-04-20 13:48:09.000000000 +0000
@@ -23,6 +23,12 @@
crc: Crc,
}
+impl Default for Crc {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl Crc {
/// Create a new CRC.
pub fn new() -> Crc {
diff -Nru cargo-0.58.0/vendor/flate2/src/deflate/bufread.rs cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/bufread.rs
--- cargo-0.58.0/vendor/flate2/src/deflate/bufread.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/bufread.rs 2022-04-20 13:48:09.000000000 +0000
@@ -2,11 +2,6 @@
use std::io::prelude::*;
use std::mem;
-#[cfg(feature = "tokio")]
-use futures::Poll;
-#[cfg(feature = "tokio")]
-use tokio_io::{AsyncRead, AsyncWrite};
-
use crate::zio;
use crate::{Compress, Decompress};
@@ -116,9 +111,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for DeflateEncoder {}
-
impl Write for DeflateEncoder {
fn write(&mut self, buf: &[u8]) -> io::Result {
self.get_mut().write(buf)
@@ -129,13 +121,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncWrite for DeflateEncoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.get_mut().shutdown()
- }
-}
-
/// A DEFLATE decoder, or decompressor.
///
/// This structure consumes a [`BufRead`] interface, reading compressed data
@@ -247,9 +232,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for DeflateDecoder {}
-
impl Write for DeflateDecoder {
fn write(&mut self, buf: &[u8]) -> io::Result {
self.get_mut().write(buf)
@@ -259,10 +241,3 @@
self.get_mut().flush()
}
}
-
-#[cfg(feature = "tokio")]
-impl AsyncWrite for DeflateDecoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.get_mut().shutdown()
- }
-}
diff -Nru cargo-0.58.0/vendor/flate2/src/deflate/mod.rs cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/mod.rs
--- cargo-0.58.0/vendor/flate2/src/deflate/mod.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/mod.rs 2022-04-20 13:48:09.000000000 +0000
@@ -17,7 +17,7 @@
let mut w = write::DeflateEncoder::new(Vec::new(), Compression::default());
let v = crate::random_bytes().take(1024).collect::>();
for _ in 0..200 {
- let to_write = &v[..thread_rng().gen_range(0, v.len())];
+ let to_write = &v[..thread_rng().gen_range(0..v.len())];
real.extend(to_write.iter().map(|x| *x));
w.write_all(to_write).unwrap();
}
@@ -46,7 +46,7 @@
let mut w = write::DeflateEncoder::new(Vec::new(), Compression::default());
let v = crate::random_bytes().take(1024).collect::>();
for _ in 0..200 {
- let to_write = &v[..thread_rng().gen_range(0, v.len())];
+ let to_write = &v[..thread_rng().gen_range(0..v.len())];
real.extend(to_write.iter().map(|x| *x));
w.write_all(to_write).unwrap();
}
diff -Nru cargo-0.58.0/vendor/flate2/src/deflate/read.rs cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/read.rs
--- cargo-0.58.0/vendor/flate2/src/deflate/read.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/read.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,11 +1,6 @@
use std::io;
use std::io::prelude::*;
-#[cfg(feature = "tokio")]
-use futures::Poll;
-#[cfg(feature = "tokio")]
-use tokio_io::{AsyncRead, AsyncWrite};
-
use super::bufread;
use crate::bufreader::BufReader;
@@ -113,9 +108,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for DeflateEncoder {}
-
impl Write for DeflateEncoder {
fn write(&mut self, buf: &[u8]) -> io::Result {
self.get_mut().write(buf)
@@ -126,13 +118,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncWrite for DeflateEncoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.get_mut().shutdown()
- }
-}
-
/// A DEFLATE decoder, or decompressor.
///
/// This structure implements a [`Read`] interface and takes a stream of
@@ -245,9 +230,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for DeflateDecoder {}
-
impl Write for DeflateDecoder {
fn write(&mut self, buf: &[u8]) -> io::Result {
self.get_mut().write(buf)
@@ -257,10 +239,3 @@
self.get_mut().flush()
}
}
-
-#[cfg(feature = "tokio")]
-impl AsyncWrite for DeflateDecoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.get_mut().shutdown()
- }
-}
diff -Nru cargo-0.58.0/vendor/flate2/src/deflate/write.rs cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/write.rs
--- cargo-0.58.0/vendor/flate2/src/deflate/write.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/deflate/write.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,11 +1,6 @@
use std::io;
use std::io::prelude::*;
-#[cfg(feature = "tokio")]
-use futures::Poll;
-#[cfg(feature = "tokio")]
-use tokio_io::{AsyncRead, AsyncWrite};
-
use crate::zio;
use crate::{Compress, Decompress};
@@ -139,7 +134,7 @@
Ok(self.inner.take_inner())
}
- /// Returns the number of bytes that have been written to this compresor.
+ /// Returns the number of bytes that have been written to this compressor.
///
/// Note that not all bytes written to this object may be accounted for,
/// there may still be some active buffering.
@@ -166,23 +161,12 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncWrite for DeflateEncoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.inner.finish()?;
- self.inner.get_mut().shutdown()
- }
-}
-
impl Read for DeflateEncoder {
fn read(&mut self, buf: &mut [u8]) -> io::Result {
self.inner.get_mut().read(buf)
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for DeflateEncoder {}
-
/// A DEFLATE decoder, or decompressor.
///
/// This structure implements a [`Write`] and will emit a stream of decompressed
@@ -331,19 +315,8 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncWrite for DeflateDecoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.inner.finish()?;
- self.inner.get_mut().shutdown()
- }
-}
-
impl Read for DeflateDecoder {
fn read(&mut self, buf: &mut [u8]) -> io::Result {
self.inner.get_mut().read(buf)
}
}
-
-#[cfg(feature = "tokio")]
-impl AsyncRead for DeflateDecoder {}
diff -Nru cargo-0.58.0/vendor/flate2/src/ffi/c.rs cargo-0.60.0ubuntu1/vendor/flate2/src/ffi/c.rs
--- cargo-0.58.0/vendor/flate2/src/ffi/c.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/ffi/c.rs 2022-04-20 13:48:09.000000000 +0000
@@ -109,7 +109,7 @@
extern "C" fn zfree(_ptr: *mut c_void, address: *mut c_void) {
unsafe {
- // Move our address being free'd back one pointer, read the size we
+ // Move our address being freed back one pointer, read the size we
// stored in `zalloc`, and then free it using the standard Rust
// allocator.
let ptr = (address as *mut usize).offset(-1);
diff -Nru cargo-0.58.0/vendor/flate2/src/gz/bufread.rs cargo-0.60.0ubuntu1/vendor/flate2/src/gz/bufread.rs
--- cargo-0.58.0/vendor/flate2/src/gz/bufread.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/gz/bufread.rs 2022-04-20 13:48:09.000000000 +0000
@@ -3,11 +3,6 @@
use std::io::prelude::*;
use std::mem;
-#[cfg(feature = "tokio")]
-use futures::Poll;
-#[cfg(feature = "tokio")]
-use tokio_io::{AsyncRead, AsyncWrite};
-
use super::{GzBuilder, GzHeader};
use super::{FCOMMENT, FEXTRA, FHCRC, FNAME};
use crate::crc::{Crc, CrcReader};
@@ -20,7 +15,7 @@
*slot = *val;
}
*pos += min;
- return min;
+ min
}
pub(crate) fn corrupt() -> io::Error {
@@ -126,15 +121,7 @@
let mut reader = Buffer::new(&mut part, r);
read_gz_header_part(&mut reader)
};
-
- match result {
- Ok(()) => {
- return Ok(part.take_header());
- }
- Err(err) => {
- return Err(err);
- }
- };
+ result.map(|()| part.take_header())
}
/// A gzip streaming encoder
@@ -179,7 +166,7 @@
let crc = CrcReader::new(r);
GzEncoder {
inner: deflate::bufread::DeflateEncoder::new(crc, lvl),
- header: header,
+ header,
pos: 0,
eof: false,
}
@@ -363,7 +350,7 @@
}
pub fn take_header(self) -> GzHeader {
- return self.header;
+ self.header
}
}
@@ -443,7 +430,7 @@
self.part.buf.truncate(0);
self.buf_cur = 0;
self.buf_max = 0;
- return Ok(rlen);
+ Ok(rlen)
}
}
@@ -523,7 +510,7 @@
let mut reader = Buffer::new(&mut part, reader.get_mut().get_mut());
read_gz_header_part(&mut reader)
};
- let state = match result {
+ match result {
Ok(()) => {
*header = Some(part.take_header());
GzState::Body
@@ -533,8 +520,7 @@
return Err(err);
}
Err(err) => return Err(err),
- };
- state
+ }
}
GzState::Body => {
if into.is_empty() {
@@ -619,9 +605,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for GzDecoder {}
-
impl Write for GzDecoder {
fn write(&mut self, buf: &[u8]) -> io::Result {
self.get_mut().write(buf)
@@ -632,13 +615,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncWrite for GzDecoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.get_mut().shutdown()
- }
-}
-
/// A gzip streaming decoder that decodes all members of a multistream
///
/// A gzip member consists of a header, compressed data and a trailer. The [gzip
@@ -722,26 +698,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for MultiGzDecoder {}
-
-impl Write for MultiGzDecoder {
- fn write(&mut self, buf: &[u8]) -> io::Result {
- self.get_mut().write(buf)
- }
-
- fn flush(&mut self) -> io::Result<()> {
- self.get_mut().flush()
- }
-}
-
-#[cfg(feature = "tokio")]
-impl AsyncWrite for MultiGzDecoder {
- fn shutdown(&mut self) -> Poll<(), io::Error> {
- self.get_mut().shutdown()
- }
-}
-
#[cfg(test)]
pub mod tests {
use crate::gz::bufread::*;
@@ -870,7 +826,7 @@
}
r.set_position(pos2);
- // Fourth read : now succesful for 7 bytes
+ // Fourth read : now successful for 7 bytes
let mut reader3 = Buffer::new(&mut part, &mut r);
match reader3.read_and_forget(&mut out) {
Ok(7) => {
@@ -882,7 +838,7 @@
}
}
- // Fifth read : succesful for one more byte
+ // Fifth read : successful for one more byte
out.resize(1, 0);
match reader3.read_and_forget(&mut out) {
Ok(1) => {
diff -Nru cargo-0.58.0/vendor/flate2/src/gz/mod.rs cargo-0.60.0ubuntu1/vendor/flate2/src/gz/mod.rs
--- cargo-0.58.0/vendor/flate2/src/gz/mod.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/gz/mod.rs 2022-04-20 13:48:09.000000000 +0000
@@ -117,6 +117,12 @@
mtime: u32,
}
+impl Default for GzBuilder {
+ fn default() -> Self {
+ Self::new()
+ }
+}
+
impl GzBuilder {
/// Create a new blank builder with no header by default.
pub fn new() -> GzBuilder {
@@ -204,28 +210,19 @@
} = self;
let mut flg = 0;
let mut header = vec![0u8; 10];
- match extra {
- Some(v) => {
- flg |= FEXTRA;
- header.push((v.len() >> 0) as u8);
- header.push((v.len() >> 8) as u8);
- header.extend(v);
- }
- None => {}
+ if let Some(v) = extra {
+ flg |= FEXTRA;
+ header.push((v.len() >> 0) as u8);
+ header.push((v.len() >> 8) as u8);
+ header.extend(v);
}
- match filename {
- Some(filename) => {
- flg |= FNAME;
- header.extend(filename.as_bytes_with_nul().iter().map(|x| *x));
- }
- None => {}
+ if let Some(filename) = filename {
+ flg |= FNAME;
+ header.extend(filename.as_bytes_with_nul().iter().map(|x| *x));
}
- match comment {
- Some(comment) => {
- flg |= FCOMMENT;
- header.extend(comment.as_bytes_with_nul().iter().map(|x| *x));
- }
- None => {}
+ if let Some(comment) = comment {
+ flg |= FCOMMENT;
+ header.extend(comment.as_bytes_with_nul().iter().map(|x| *x));
}
header[0] = 0x1f;
header[1] = 0x8b;
@@ -248,7 +245,7 @@
// default this value to 255. I'm not sure that if we "correctly" set
// this it'd do anything anyway...
header[9] = operating_system.unwrap_or(255);
- return header;
+ header
}
}
@@ -287,7 +284,7 @@
let mut w = write::GzEncoder::new(Vec::new(), Compression::default());
let v = crate::random_bytes().take(1024).collect::>();
for _ in 0..200 {
- let to_write = &v[..thread_rng().gen_range(0, v.len())];
+ let to_write = &v[..thread_rng().gen_range(0..v.len())];
real.extend(to_write.iter().map(|x| *x));
w.write_all(to_write).unwrap();
}
diff -Nru cargo-0.58.0/vendor/flate2/src/gz/read.rs cargo-0.60.0ubuntu1/vendor/flate2/src/gz/read.rs
--- cargo-0.58.0/vendor/flate2/src/gz/read.rs 2021-12-20 10:27:19.000000000 +0000
+++ cargo-0.60.0ubuntu1/vendor/flate2/src/gz/read.rs 2022-04-20 13:48:09.000000000 +0000
@@ -1,11 +1,6 @@
use std::io;
use std::io::prelude::*;
-#[cfg(feature = "tokio")]
-use futures::Poll;
-#[cfg(feature = "tokio")]
-use tokio_io::{AsyncRead, AsyncWrite};
-
use super::bufread;
use super::{GzBuilder, GzHeader};
use crate::bufreader::BufReader;
@@ -43,7 +38,7 @@
}
pub fn gz_encoder(inner: bufread::GzEncoder>) -> GzEncoder {
- GzEncoder { inner: inner }
+ GzEncoder { inner }
}
impl GzEncoder {
@@ -175,9 +170,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncRead for GzDecoder {}
-
impl Write for GzDecoder {
fn write(&mut self, buf: &[u8]) -> io::Result {
self.get_mut().write(buf)
@@ -188,13 +180,6 @@
}
}
-#[cfg(feature = "tokio")]
-impl AsyncWrite for GzDecoder