File tree 9 files changed +13
-10
lines changed
crates/resolver-tests/src
tests/testsuite/cargo_add/add_no_vendored_package_with_vendor
9 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ pub fn resolve_with_config_raw(
112
112
let matched = match kind {
113
113
QueryKind :: Exact => dep. matches ( summary) ,
114
114
QueryKind :: Fuzzy => true ,
115
+ QueryKind :: Normalized => true ,
115
116
} ;
116
117
if matched {
117
118
self . used . insert ( summary. package_id ( ) ) ;
Original file line number Diff line number Diff line change @@ -584,7 +584,7 @@ fn get_latest_dependency(
584
584
}
585
585
MaybeWorkspace :: Other ( query) => {
586
586
let possibilities = loop {
587
- match registry. query_vec ( & query, QueryKind :: Fuzzy ) {
587
+ match registry. query_vec ( & query, QueryKind :: Normalized ) {
588
588
std:: task:: Poll :: Ready ( res) => {
589
589
break res?;
590
590
}
@@ -707,7 +707,7 @@ fn select_package(
707
707
MaybeWorkspace :: Other ( query) => {
708
708
let possibilities = loop {
709
709
// Exact to avoid returning all for path/git
710
- match registry. query_vec ( & query, QueryKind :: Exact ) {
710
+ match registry. query_vec ( & query, QueryKind :: Normalized ) {
711
711
std:: task:: Poll :: Ready ( res) => {
712
712
break res?;
713
713
}
@@ -934,7 +934,7 @@ fn populate_available_features(
934
934
}
935
935
936
936
let possibilities = loop {
937
- match registry. query_vec ( & query, QueryKind :: Exact ) {
937
+ match registry. query_vec ( & query, QueryKind :: Normalized ) {
938
938
std:: task:: Poll :: Ready ( res) => {
939
939
break res?;
940
940
}
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ impl<'cfg> Source for DirectorySource<'cfg> {
109
109
let matches = packages. filter ( |pkg| match kind {
110
110
QueryKind :: Exact => dep. matches ( pkg. summary ( ) ) ,
111
111
QueryKind :: Fuzzy => true ,
112
+ QueryKind :: Normalized => dep. matches ( pkg. summary ( ) ) ,
112
113
} ) ;
113
114
for summary in matches. map ( |pkg| pkg. summary ( ) . clone ( ) ) {
114
115
f ( IndexSummary :: Candidate ( summary) ) ;
Original file line number Diff line number Diff line change @@ -555,6 +555,7 @@ impl<'cfg> Source for PathSource<'cfg> {
555
555
let matched = match kind {
556
556
QueryKind :: Exact => dep. matches ( s) ,
557
557
QueryKind :: Fuzzy => true ,
558
+ QueryKind :: Normalized => dep. matches ( s) ,
558
559
} ;
559
560
if matched {
560
561
f ( IndexSummary :: Candidate ( s. clone ( ) ) )
Original file line number Diff line number Diff line change @@ -793,6 +793,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
793
793
let matched = match kind {
794
794
QueryKind :: Exact => dep. matches( s. as_summary( ) ) ,
795
795
QueryKind :: Fuzzy => true ,
796
+ QueryKind :: Normalized => true ,
796
797
} ;
797
798
if !matched {
798
799
return ;
@@ -831,7 +832,7 @@ impl<'cfg> Source for RegistrySource<'cfg> {
831
832
return Poll :: Ready ( Ok ( ( ) ) ) ;
832
833
}
833
834
let mut any_pending = false ;
834
- if kind == QueryKind :: Fuzzy {
835
+ if kind == QueryKind :: Fuzzy || kind == QueryKind :: Normalized {
835
836
// Attempt to handle misspellings by searching for a chain of related
836
837
// names to the original name. The resolver will later
837
838
// reject any candidates that have the wrong name, and with this it'll
Original file line number Diff line number Diff line change @@ -180,6 +180,9 @@ pub enum QueryKind {
180
180
/// whereas an `Registry` source may return dependencies that have the same
181
181
/// canonicalization.
182
182
Fuzzy ,
183
+ /// Match a denpendency in all ways and will normalize the package name.
184
+ /// Each source defines what normalizing means.
185
+ Normalized ,
183
186
}
184
187
185
188
/// A download status that represents if a [`Package`] has already been
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ version = "0.0.0"
47
47
. arg_line ( "cbindgen" )
48
48
. current_dir ( cwd)
49
49
. assert ( )
50
- . success ( )
50
+ . failure ( )
51
51
. stdout_matches_path ( curr_dir ! ( ) . join ( "stdout.log" ) )
52
52
. stderr_matches_path ( curr_dir ! ( ) . join ( "stderr.log" ) ) ;
53
53
Original file line number Diff line number Diff line change 3
3
[package ]
4
4
name = " cargo-list-test-fixture"
5
5
version = " 0.0.0"
6
-
7
- [dependencies ]
8
- aa = " 0.0.0"
Original file line number Diff line number Diff line change 1
- warning: translating `cbindgen` to `aa`
2
- Adding aa v0.0.0 to dependencies.
1
+ error: the crate `cbindgen` could not be found in registry index.
You can’t perform that action at this time.
0 commit comments