Skip to content

Commit

Permalink
Fix the broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Aug 24, 2023
1 parent 7c01a5b commit f791293
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/cargo/core/compiler/compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,13 +458,13 @@ fn target_runner(

/// Gets the user-specified linker for a particular host or target from the configuration.
fn target_linker(bcx: &BuildContext<'_, '_>, kind: CompileKind) -> CargoResult<Option<PathBuf>> {
let target = bcx.target_data.short_name(&kind);

// try target.{}.runner
let key = format!("target.{}.linker", target);

if let Some(v) = bcx.config.get::<Option<config::ConfigRelativePath>>(&key)? {
let path = v.resolve_program(bcx.config);
if let Some(path) = bcx
.target_data
.target_config(kind)
.linker
.as_ref()
.map(|l| l.val.clone().resolve_program(bcx.config))
{
return Ok(Some(path));
}

Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/tool_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ fn cfg_ignored_fields() {
[WARNING] unused key `ar` in [target] config table `cfg(not(target_os = \"none\"))`
[WARNING] unused key `foo` in [target] config table `cfg(not(target_os = \"none\"))`
[WARNING] unused key `invalid` in [target] config table `cfg(not(target_os = \"none\"))`
[WARNING] unused key `linker` in [target] config table `cfg(not(target_os = \"none\"))`
[CHECKING] foo v0.0.1 ([..])
[FINISHED] [..]
",
Expand Down

0 comments on commit f791293

Please sign in to comment.