File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
src/cargo/core/compiler/build_context Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -292,7 +292,9 @@ impl TargetInfo {
292
292
suffix : ".pdb" . to_string ( ) ,
293
293
prefix : prefix. clone ( ) ,
294
294
flavor : FileFlavor :: DebugInfo ,
295
- should_replace_hyphens : false ,
295
+ // rustc calls the linker with underscores, and the
296
+ // filename is embedded in the executable.
297
+ should_replace_hyphens : true ,
296
298
} )
297
299
}
298
300
}
Original file line number Diff line number Diff line change @@ -4201,6 +4201,7 @@ fn uplift_pdb_of_bin_on_windows() {
4201
4201
let p = project ( )
4202
4202
. file ( "src/main.rs" , "fn main() { panic!(); }" )
4203
4203
. file ( "src/bin/b.rs" , "fn main() { panic!(); }" )
4204
+ . file ( "src/bin/foo-bar.rs" , "fn main() { panic!(); }" )
4204
4205
. file ( "examples/c.rs" , "fn main() { panic!(); }" )
4205
4206
. file ( "tests/d.rs" , "fn main() { panic!(); }" )
4206
4207
. build ( ) ;
@@ -4209,6 +4210,8 @@ fn uplift_pdb_of_bin_on_windows() {
4209
4210
assert ! ( p. target_debug_dir( ) . join( "foo.pdb" ) . is_file( ) ) ;
4210
4211
assert ! ( p. target_debug_dir( ) . join( "b.pdb" ) . is_file( ) ) ;
4211
4212
assert ! ( p. target_debug_dir( ) . join( "examples/c.pdb" ) . exists( ) ) ;
4213
+ assert ! ( p. target_debug_dir( ) . join( "foo-bar.exe" ) . is_file( ) ) ;
4214
+ assert ! ( p. target_debug_dir( ) . join( "foo_bar.pdb" ) . is_file( ) ) ;
4212
4215
assert ! ( !p. target_debug_dir( ) . join( "c.pdb" ) . exists( ) ) ;
4213
4216
assert ! ( !p. target_debug_dir( ) . join( "d.pdb" ) . exists( ) ) ;
4214
4217
}
You can’t perform that action at this time.
0 commit comments