Skip to content

Commit 5a36a26

Browse files
committed
Emit warning while outputs is not exe and prints linkage info
Signed-off-by: xizheyin <[email protected]>
1 parent b74da96 commit 5a36a26

File tree

1 file changed

+10
-0
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+10
-0
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@ pub fn link_binary(
172172
}
173173
tempfiles_for_stdout_output.push(out_filename);
174174
}
175+
} else {
176+
for print in &sess.opts.prints {
177+
if print.kind == PrintKind::LinkArgs || print.kind == PrintKind::NativeStaticLibs {
178+
sess.dcx().warn(format!(
179+
"skipping link step due to conflict: cannot output linkage information without emitting executable"
180+
));
181+
sess.dcx()
182+
.note(format!("consider emitting executable to print linkage information"));
183+
}
184+
}
175185
}
176186
}
177187

0 commit comments

Comments
 (0)