diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index 4a4c22b468e..ed36c31f331 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -856,7 +856,13 @@ impl<'gctx> Source for RegistrySource<'gctx> { } any_pending |= self .index - .query_inner(name_permutation, &req, &mut *self.ops, f)? + .query_inner(name_permutation, &req, &mut *self.ops, &mut |s| { + if !s.is_yanked() { + f(s); + } else if kind == QueryKind::Alternatives { + f(s); + } + })? .is_pending(); } } diff --git a/tests/testsuite/cargo_add/normalize_name_registry_yanked/mod.rs b/tests/testsuite/cargo_add/normalize_name_registry_yanked/mod.rs index 91950756ee3..4b3bedb34ea 100644 --- a/tests/testsuite/cargo_add/normalize_name_registry_yanked/mod.rs +++ b/tests/testsuite/cargo_add/normalize_name_registry_yanked/mod.rs @@ -23,7 +23,7 @@ fn case() { .arg_line("linked_hash_map") .current_dir(cwd) .assert() - .failure() + .success() .stdout_eq(str![""]) .stderr_eq(file!["stderr.term.svg"]); diff --git a/tests/testsuite/cargo_add/normalize_name_registry_yanked/out/Cargo.toml b/tests/testsuite/cargo_add/normalize_name_registry_yanked/out/Cargo.toml index 946b7c86bf0..89e018f0e01 100644 --- a/tests/testsuite/cargo_add/normalize_name_registry_yanked/out/Cargo.toml +++ b/tests/testsuite/cargo_add/normalize_name_registry_yanked/out/Cargo.toml @@ -4,3 +4,6 @@ name = "cargo-list-test-fixture" version = "0.0.0" edition = "2015" + +[dependencies] +linked-hash-map = "0.5.4" diff --git a/tests/testsuite/cargo_add/normalize_name_registry_yanked/stderr.term.svg b/tests/testsuite/cargo_add/normalize_name_registry_yanked/stderr.term.svg index 7970291d956..4766fc1a798 100644 --- a/tests/testsuite/cargo_add/normalize_name_registry_yanked/stderr.term.svg +++ b/tests/testsuite/cargo_add/normalize_name_registry_yanked/stderr.term.svg @@ -1,9 +1,8 @@ - +