Skip to content

Commit 8f6aaa2

Browse files
committed
rustc_codegen_ssa: reduce repetition
1 parent d221d41 commit 8f6aaa2

File tree

1 file changed

+3
-5
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+3
-5
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,11 +1407,9 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
14071407
Some(LinkerFlavorCli::Llbc) => Some(LinkerFlavor::Llbc),
14081408
Some(LinkerFlavorCli::Ptx) => Some(LinkerFlavor::Ptx),
14091409
// The linker flavors that corresponds to targets needs logic that keeps the base LinkerFlavor
1410-
_ => sess
1411-
.opts
1412-
.cg
1413-
.linker_flavor
1414-
.map(|flavor| sess.target.linker_flavor.with_cli_hints(flavor)),
1410+
linker_flavor => {
1411+
linker_flavor.map(|flavor| sess.target.linker_flavor.with_cli_hints(flavor))
1412+
}
14151413
};
14161414
if let Some(ret) = infer_from(sess, sess.opts.cg.linker.clone(), linker_flavor, features) {
14171415
return ret;

0 commit comments

Comments
 (0)