File tree 2 files changed +28
-3
lines changed
2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -224,10 +224,10 @@ unable to verify that `{0}` is the same as when the lockfile was generated
224
224
let crate_name = to_target. crate_name ( ) ;
225
225
let mut names = deps. iter ( ) . map ( |d| {
226
226
d. explicit_name_in_toml ( )
227
- . map ( |s| s. as_str ( ) )
228
- . unwrap_or ( & crate_name)
227
+ . map ( |s| s. as_str ( ) . replace ( "-" , "_" ) )
228
+ . unwrap_or ( crate_name. clone ( ) )
229
229
} ) ;
230
- let name = names. next ( ) . unwrap_or ( & crate_name) ;
230
+ let name = names. next ( ) . unwrap_or ( crate_name. clone ( ) ) ;
231
231
for n in names {
232
232
if n == name {
233
233
continue ;
Original file line number Diff line number Diff line change @@ -433,3 +433,28 @@ Caused by:
433
433
" ,
434
434
) . run ( ) ;
435
435
}
436
+
437
+ #[ test]
438
+ fn rename_with_dash ( ) {
439
+ let p = project ( )
440
+ . file (
441
+ "Cargo.toml" ,
442
+ r#"
443
+ cargo-features = ["rename-dependency"]
444
+ [package]
445
+ name = "qwerty"
446
+ version = "0.1.0"
447
+
448
+ [dependencies]
449
+ foo-bar = { path = 'a', package = 'a' }
450
+ "# ,
451
+ )
452
+ . file ( "src/lib.rs" , "extern crate foo_bar;" )
453
+ . file ( "a/Cargo.toml" , & basic_manifest ( "a" , "0.1.0" ) )
454
+ . file ( "a/src/lib.rs" , "" )
455
+ . build ( ) ;
456
+
457
+ p. cargo ( "build" )
458
+ . masquerade_as_nightly_cargo ( )
459
+ . run ( ) ;
460
+ }
You can’t perform that action at this time.
0 commit comments