@@ -197,7 +197,7 @@ impl<'cfg> PackageRegistry<'cfg> {
197
197
// of summaries which should be the same length as `deps` above.
198
198
let unlocked_summaries = deps. iter ( )
199
199
. map ( |dep| {
200
- debug ! ( "registring a patch for `{}` with `{}`" , url, dep. name ( ) ) ;
200
+ debug ! ( "registring a patch for `{}` with `{}`" , url, dep. package_name ( ) ) ;
201
201
202
202
// Go straight to the source for resolving `dep`. Load it as we
203
203
// normally would and then ask it directly for the list of summaries
@@ -207,7 +207,7 @@ impl<'cfg> PackageRegistry<'cfg> {
207
207
format_err ! (
208
208
"failed to load source for a dependency \
209
209
on `{}`",
210
- dep. name ( )
210
+ dep. package_name ( )
211
211
)
212
212
} ) ?;
213
213
@@ -223,22 +223,22 @@ impl<'cfg> PackageRegistry<'cfg> {
223
223
"patch for `{}` in `{}` did not resolve to any crates. If this is \
224
224
unexpected, you may wish to consult: \
225
225
https://github.com/rust-lang/cargo/issues/4678",
226
- dep. name ( ) ,
226
+ dep. package_name ( ) ,
227
227
url
228
228
) ,
229
229
} ;
230
230
if summaries. next ( ) . is_some ( ) {
231
231
bail ! (
232
232
"patch for `{}` in `{}` resolved to more than one candidate" ,
233
- dep. name ( ) ,
233
+ dep. package_name ( ) ,
234
234
url
235
235
)
236
236
}
237
237
if summary. package_id ( ) . source_id ( ) . url ( ) == url {
238
238
bail ! (
239
239
"patch for `{}` in `{}` points to the same source, but \
240
240
patches must point to different sources",
241
- dep. name ( ) ,
241
+ dep. package_name ( ) ,
242
242
url
243
243
) ;
244
244
}
@@ -306,7 +306,7 @@ impl<'cfg> PackageRegistry<'cfg> {
306
306
fn query_overrides ( & mut self , dep : & Dependency ) -> CargoResult < Option < Summary > > {
307
307
for s in self . overrides . iter ( ) {
308
308
let src = self . sources . get_mut ( s) . unwrap ( ) ;
309
- let dep = Dependency :: new_override ( & * dep. name ( ) , s) ;
309
+ let dep = Dependency :: new_override ( & * dep. package_name ( ) , s) ;
310
310
let mut results = src. query_vec ( & dep) ?;
311
311
if !results. is_empty ( ) {
312
312
return Ok ( Some ( results. remove ( 0 ) ) ) ;
@@ -369,21 +369,21 @@ http://doc.crates.io/specifying-dependencies.html#overriding-dependencies
369
369
modified to not match the previously resolved version\n \n \
370
370
{}",
371
371
override_summary. package_id( ) . name( ) ,
372
- dep. name ( ) ,
372
+ dep. package_name ( ) ,
373
373
boilerplate
374
374
) ;
375
375
self . source_config . config ( ) . shell ( ) . warn ( & msg) ?;
376
376
return Ok ( ( ) ) ;
377
377
}
378
378
379
- if let Some ( id ) = real_deps. get ( 0 ) {
379
+ if let Some ( dep ) = real_deps. get ( 0 ) {
380
380
let msg = format ! (
381
381
"\
382
382
path override for crate `{}` has altered the original list of
383
383
dependencies; the dependency on `{}` was removed\n \n
384
384
{}" ,
385
385
override_summary. package_id( ) . name( ) ,
386
- id . name ( ) ,
386
+ dep . package_name ( ) ,
387
387
boilerplate
388
388
) ;
389
389
self . source_config . config ( ) . shell ( ) . warn ( & msg) ?;
@@ -439,7 +439,7 @@ impl<'cfg> Registry for PackageRegistry<'cfg> {
439
439
with `{}`, \
440
440
looking at sources",
441
441
patches. len( ) ,
442
- dep. name ( ) ,
442
+ dep. package_name ( ) ,
443
443
dep. source_id( ) ,
444
444
dep. version_req( )
445
445
) ;
@@ -451,7 +451,7 @@ impl<'cfg> Registry for PackageRegistry<'cfg> {
451
451
format_err ! (
452
452
"failed to load source for a dependency \
453
453
on `{}`",
454
- dep. name ( )
454
+ dep. package_name ( )
455
455
)
456
456
} ) ?;
457
457
@@ -542,7 +542,7 @@ fn lock(locked: &LockedMap, patches: &HashMap<Url, Vec<PackageId>>, summary: Sum
542
542
None => summary,
543
543
} ;
544
544
summary. map_dependencies ( |dep| {
545
- trace ! ( "\t {}/{}/{}" , dep. name ( ) , dep. version_req( ) , dep. source_id( ) ) ;
545
+ trace ! ( "\t {}/{}/{}" , dep. package_name ( ) , dep. version_req( ) , dep. source_id( ) ) ;
546
546
547
547
// If we've got a known set of overrides for this summary, then
548
548
// one of a few cases can arise:
@@ -578,7 +578,7 @@ fn lock(locked: &LockedMap, patches: &HashMap<Url, Vec<PackageId>>, summary: Sum
578
578
// If anything does then we lock it to that and move on.
579
579
let v = locked
580
580
. get ( dep. source_id ( ) )
581
- . and_then ( |map| map. get ( & * dep. name ( ) ) )
581
+ . and_then ( |map| map. get ( & * dep. package_name ( ) ) )
582
582
. and_then ( |vec| vec. iter ( ) . find ( |& & ( ref id, _) | dep. matches_id ( id) ) ) ;
583
583
if let Some ( & ( ref id, _) ) = v {
584
584
trace ! ( "\t second hit on {}" , id) ;
@@ -592,7 +592,7 @@ fn lock(locked: &LockedMap, patches: &HashMap<Url, Vec<PackageId>>, summary: Sum
592
592
let v = patches. get ( dep. source_id ( ) . url ( ) ) . map ( |vec| {
593
593
let dep2 = dep. clone ( ) ;
594
594
let mut iter = vec. iter ( ) . filter ( move |p| {
595
- dep2. name ( ) == p . name ( ) && dep2 . version_req ( ) . matches ( p . version ( ) )
595
+ dep2. matches_ignoring_source ( p )
596
596
} ) ;
597
597
( iter. next ( ) , iter)
598
598
} ) ;
0 commit comments