Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/cargo/core/package.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/alt_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
9 changes: 5 additions & 4 deletions tests/testsuite/artifact_dep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/cargo_tree/deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/cargo_tree/dupe/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 19 additions & 19 deletions tests/testsuite/cargo_tree/edge_kind/stderr.term.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testsuite/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ fn works_through_the_registry() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] baz v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] bar v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] baz v0.1.0 (registry `dummy-registry`)
[CHECKING] baz v0.1.0
[CHECKING] bar v0.1.0
[CHECKING] foo v0.0.1 ([ROOT]/foo)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3951,8 +3951,8 @@ fn mergeable_info_dep_collision() {
[LOCKING] 2 packages to latest compatible versions
[ADDING] dep v0.1.0 (available: v0.2.0)
[DOWNLOADING] crates ...
[DOWNLOADED] dep v0.2.0 (registry `dummy-registry`)
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] dep v0.2.0 (registry `dummy-registry`)
[DOCUMENTING] dep v0.1.0
[RUNNING] `rustdoc [..]--crate-name dep [..]--merge=none --parts-out-dir=[ROOT]/foo/target/debug/build/dep-[HASH]/out [..]--crate-version 0.1.0`
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2267,8 +2267,8 @@ fn registry_summary_order_doesnt_matter() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] bar v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[COMPILING] dep v0.1.0
[COMPILING] bar v0.1.0
[COMPILING] foo v0.1.0 ([ROOT]/foo)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/features_namespaced.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ fn dependency_with_crate_syntax() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] baz v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] baz v1.0.0 (registry `dummy-registry`)
[CHECKING] baz v1.0.0
[CHECKING] bar v1.0.0
[CHECKING] foo v0.1.0 ([ROOT]/foo)
Expand Down
3 changes: 1 addition & 2 deletions tests/testsuite/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ fn fetch_all_platform_dependencies_when_no_target_is_given() {
.with_stderr_data(str![[r#"
...
[DOWNLOADED] d1 v1.2.3 (registry `dummy-registry`)
[DOWNLOADED] d2 v0.1.2 (registry `dummy-registry`)
...

"#]])
.run();
}
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/future_incompat_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,9 +580,9 @@ fn suggestions_for_updates() {
.env("RUSTFLAGS", "-Zfuture-incompat-test")
.with_stderr_data(str![[r#"
[DOWNLOADING] crates ...
[DOWNLOADED] without_updates v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] with_updates v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] big_update v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] with_updates v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] without_updates v1.0.0 (registry `dummy-registry`)
[CHECKING] with_updates v1.0.0
[CHECKING] big_update v1.0.0
[CHECKING] without_updates v1.0.0
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/inheritable_workspace_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1171,8 +1171,8 @@ fn inherit_dependency_features() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[CHECKING] fancy_dep v0.2.4
[CHECKING] dep v0.1.0
[CHECKING] bar v0.2.0 ([ROOT]/foo)
Expand Down Expand Up @@ -1539,8 +1539,8 @@ fn warn_inherit_def_feat_true_member_def_feat_false() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[CHECKING] fancy_dep v0.2.4
[CHECKING] dep v0.1.0
[CHECKING] bar v0.2.0 ([ROOT]/foo)
Expand Down Expand Up @@ -1631,8 +1631,8 @@ fn warn_inherit_simple_member_def_feat_false() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[CHECKING] fancy_dep v0.2.4
[CHECKING] dep v0.1.0
[CHECKING] bar v0.2.0 ([ROOT]/foo)
Expand Down Expand Up @@ -1723,8 +1723,8 @@ fn inherit_def_feat_false_member_def_feat_true() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[DOWNLOADED] dep v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] fancy_dep v0.2.4 (registry `dummy-registry`)
[CHECKING] fancy_dep v0.2.4
[CHECKING] dep v0.1.0
[CHECKING] bar v0.2.0 ([ROOT]/foo)
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/lints/unused_dependencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,8 @@ fn pinned_transitive_dep() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] transitive v0.1.1 (registry `dummy-registry`)
[DOWNLOADED] intermediate v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] transitive v0.1.1 (registry `dummy-registry`)
[CHECKING] transitive v0.1.1
[CHECKING] intermediate v0.1.0
[CHECKING] foo v0.1.0 ([ROOT]/foo)
Expand Down Expand Up @@ -1305,8 +1305,8 @@ pub fn fun() -> &'static str {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] transitive v0.1.1 (registry `dummy-registry`)
[DOWNLOADED] intermediate v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] transitive v0.1.1 (registry `dummy-registry`)
[CHECKING] transitive v0.1.1
[CHECKING] intermediate v0.1.0
[CHECKING] foo v0.1.0 ([ROOT]/foo)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/offline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Caused by:
p.cargo("check --offline")
.with_status(101)
.with_stderr_data(str![[r#"
[ERROR] failed to download `bar v0.1.0`
[ERROR] failed to download `baz v1.0.0`

Caused by:
attempting to make an HTTP request, but --offline was specified
Expand Down
2 changes: 0 additions & 2 deletions tests/testsuite/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ fn always_shows_progress() {
p.cargo("check")
.with_stderr_data(
str![[r#"
[DOWNLOADING] [..] crate [..]
[DOWNLOADED] 3 crates ([..]) in [..]s
[BUILDING] [..] [..]/4: [..]
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
...
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/pub_priv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ fn publish_package_with_public_dependency() {
[UPDATING] `dummy-registry` index
[LOCKING] 2 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] pub_bar v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] bar v0.1.0 (registry `dummy-registry`)
[DOWNLOADED] pub_bar v0.1.0 (registry `dummy-registry`)
[CHECKING] pub_bar v0.1.0
[CHECKING] bar v0.1.0
[CHECKING] foo v0.0.1 ([ROOT]/foo)
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/rust_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ fn lint_dep_incompatible_with_rust_version() {
.with_status(101)
.with_stderr_data(str![[r#"
[DOWNLOADING] crates ...
[DOWNLOADED] too_new_parent v0.0.1 (registry `dummy-registry`)
[DOWNLOADED] too_new_child v0.0.1 (registry `dummy-registry`)
[DOWNLOADED] rustc_compatible v0.0.1 (registry `dummy-registry`)
[DOWNLOADED] too_new_child v0.0.1 (registry `dummy-registry`)
[DOWNLOADED] too_new_parent v0.0.1 (registry `dummy-registry`)
[ERROR] rustc [..] is not supported by the following packages:
too_new_child@0.0.1 requires rustc 1.2345.0
too_new_parent@0.0.1 requires rustc 1.2345.0
Expand Down
8 changes: 4 additions & 4 deletions tests/testsuite/weak_dep_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ fn deferred() {
[UPDATING] `dummy-registry` index
[LOCKING] 3 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] dep v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar_activator v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar_activator v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] dep v1.0.0 (registry `dummy-registry`)
[CHECKING] bar v1.0.0
[CHECKING] dep v1.0.0
[CHECKING] bar_activator v1.0.0
Expand Down Expand Up @@ -355,9 +355,9 @@ fn weak_with_host_decouple() {
[UPDATING] `dummy-registry` index
[LOCKING] 3 packages to latest compatible versions
[DOWNLOADING] crates ...
[DOWNLOADED] common v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar_activator v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] bar_activator v1.0.0 (registry `dummy-registry`)
[DOWNLOADED] common v1.0.0 (registry `dummy-registry`)
[COMPILING] bar v1.0.0
[COMPILING] common v1.0.0
[COMPILING] bar_activator v1.0.0
Expand Down