diff --git a/src/cargo/core/package.rs b/src/cargo/core/package.rs index 0fd005fe831..f3ecdd66089 100644 --- a/src/cargo/core/package.rs +++ b/src/cargo/core/package.rs @@ -1,7 +1,7 @@ use std::cell::OnceCell; use std::cell::{Cell, Ref, RefCell}; use std::cmp::Ordering; -use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet}; +use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque}; use std::fmt; use std::hash; use std::mem; @@ -313,7 +313,7 @@ pub struct Downloads<'a, 'gctx> { /// temporary holding area, needed because curl can report multiple /// downloads at once, but the main loop (`wait`) is written to only /// handle one at a time. - results: Vec<(usize, Result<(), curl::Error>)>, + results: VecDeque<(usize, Result<(), curl::Error>)>, /// The next ID to use for creating a token (see `Download::token`). next: usize, /// Progress bar. @@ -436,7 +436,7 @@ impl<'gctx> PackageSet<'gctx> { pending: HashMap::new(), pending_ids: HashSet::new(), sleeping: SleepTracker::new(), - results: Vec::new(), + results: VecDeque::new(), progress: RefCell::new(Some(Progress::with_style( "Downloading", ProgressStyle::Ratio, @@ -989,13 +989,13 @@ impl<'a, 'gctx> Downloads<'a, 'gctx> { let token = msg.token().expect("failed to read token"); let handle = &pending[&token].1; if let Some(result) = msg.result_for(handle) { - results.push((token, result)); + results.push_back((token, result)); } else { debug!(target: "network", "message without a result (?)"); } }); - if let Some(pair) = results.pop() { + if let Some(pair) = results.pop_front() { break Ok(pair); } assert_ne!(self.remaining(), 0); diff --git a/tests/testsuite/alt_registry.rs b/tests/testsuite/alt_registry.rs index 4fd9b33271d..c9c83c78353 100644 --- a/tests/testsuite/alt_registry.rs +++ b/tests/testsuite/alt_registry.rs @@ -91,8 +91,8 @@ fn depend_on_alt_registry_depends_on_same_registry_no_index() { [UPDATING] `alternative` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] baz v0.0.1 (registry `alternative`) [DOWNLOADED] bar v0.0.1 (registry `alternative`) +[DOWNLOADED] baz v0.0.1 (registry `alternative`) [CHECKING] baz v0.0.1 (registry `alternative`) [CHECKING] bar v0.0.1 (registry `alternative`) [CHECKING] foo v0.0.1 ([ROOT]/foo) @@ -134,8 +134,8 @@ fn depend_on_alt_registry_depends_on_same_registry() { [UPDATING] `alternative` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... -[DOWNLOADED] baz v0.0.1 (registry `alternative`) [DOWNLOADED] bar v0.0.1 (registry `alternative`) +[DOWNLOADED] baz v0.0.1 (registry `alternative`) [CHECKING] baz v0.0.1 (registry `alternative`) [CHECKING] bar v0.0.1 (registry `alternative`) [CHECKING] foo v0.0.1 ([ROOT]/foo) diff --git a/tests/testsuite/artifact_dep.rs b/tests/testsuite/artifact_dep.rs index 643e1071a2b..83092c5a197 100644 --- a/tests/testsuite/artifact_dep.rs +++ b/tests/testsuite/artifact_dep.rs @@ -1797,17 +1797,18 @@ fn proc_macro_in_artifact_dep() { p.cargo("check -Z bindeps") .masquerade_as_nightly_cargo(&["bindeps"]) - .with_stderr_data( - r#"... + .with_stderr_data(str![[r#" +... [UPDATING] `dummy-registry` index [LOCKING] 2 packages to latest compatible versions [DOWNLOADING] crates ... +[DOWNLOADED] bin-uses-pm v1.0.0 (registry `dummy-registry`) [ERROR] failed to download from `[ROOTURL]/dl/pm/1.0.0/download` Caused by: [37] Could[..]t read a file:// file (Could[..]t open file [ROOT]/dl/pm/1.0.0/download) -"#, - ) + +"#]]) .with_status(101) .run(); } diff --git a/tests/testsuite/cargo_tree/deps.rs b/tests/testsuite/cargo_tree/deps.rs index 97128555c96..d7e4e2b5922 100644 --- a/tests/testsuite/cargo_tree/deps.rs +++ b/tests/testsuite/cargo_tree/deps.rs @@ -1682,9 +1682,9 @@ fn ambiguous_name() { [LOCKING] 3 packages to latest compatible versions [ADDING] dep v1.0.0 (available: v2.0.0) [DOWNLOADING] crates ... -[DOWNLOADED] dep v2.0.0 (registry `dummy-registry`) -[DOWNLOADED] dep v1.0.0 (registry `dummy-registry`) [DOWNLOADED] bar v1.0.0 (registry `dummy-registry`) +[DOWNLOADED] dep v1.0.0 (registry `dummy-registry`) +[DOWNLOADED] dep v2.0.0 (registry `dummy-registry`) [ERROR] specification `dep` is ambiguous [HELP] re-run this command with one of the following specifications dep@1.0.0 diff --git a/tests/testsuite/cargo_tree/dupe/stderr.term.svg b/tests/testsuite/cargo_tree/dupe/stderr.term.svg index 9bdc9ae8baf..90da2719e6e 100644 --- a/tests/testsuite/cargo_tree/dupe/stderr.term.svg +++ b/tests/testsuite/cargo_tree/dupe/stderr.term.svg @@ -1,7 +1,7 @@