Skip to content

Commit e46d80e

Browse files
Fixes #13121: Use Exact query during populating features. Update test
fix target output
1 parent 61f6248 commit e46d80e

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/cargo/ops/cargo_add/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ fn populate_available_features(
934934
}
935935

936936
let possibilities = loop {
937-
match registry.query_vec(&query, QueryKind::Fuzzy) {
937+
match registry.query_vec(&query, QueryKind::Exact) {
938938
std::task::Poll::Ready(res) => {
939939
break res?;
940940
}

tests/testsuite/cargo_add/git_multiple_packages_features/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ fn case() {
5555
])
5656
.current_dir(cwd)
5757
.assert()
58-
.failure()
58+
.success()
5959
.stdout_matches_path(curr_dir!().join("stdout.log"))
6060
.stderr_matches_path(curr_dir!().join("stderr.log"));
6161

tests/testsuite/cargo_add/git_multiple_packages_features/out/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33
[package]
44
name = "cargo-list-test-fixture"
55
version = "0.0.0"
6+
7+
[dependencies]
8+
package-with-feature = { git = "[ROOTURL]/git-package", version = "0.1.3", features = ["target_feature"] }
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Updating git repository `[ROOTURL]/git-package`
22
Adding package-with-feature (git) to dependencies.
3-
error: unrecognized feature for crate package-with-feature: target_feature
4-
no features available for crate package-with-feature
3+
Features:
4+
+ target_feature
5+
Updating git repository `[ROOTURL]/git-package`

0 commit comments

Comments
 (0)