Skip to content

Commit f56e71f

Browse files
committed
Move native artifact notification to a helper.
1 parent 64b4b6d commit f56e71f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/librustc_trans/back/link.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -822,14 +822,20 @@ fn link_staticlib(sess: &Session, objects: &[PathBuf], out_filename: &Path,
822822
ab.update_symbols();
823823
ab.build();
824824

825-
if !all_native_libs.is_empty() {
826-
sess.note_without_error("link against the following native artifacts when linking against \
825+
report_link_line(sess, all_native_libs);
826+
}
827+
828+
fn report_link_line(sess: &Session, native_libs: Vec<(NativeLibraryKind, String)>) {
829+
if !native_libs.is_empty() {
830+
sess.note_without_error(
831+
"link against the following native artifacts when linking against \
827832
this static library");
828-
sess.note_without_error("the order and any duplication can be significant on some \
833+
sess.note_without_error(
834+
"the order and any duplication can be significant on some \
829835
platforms, and so may need to be preserved");
830836
}
831837

832-
for &(kind, ref lib) in &all_native_libs {
838+
for &(kind, ref lib) in &native_libs {
833839
let name = match kind {
834840
NativeLibraryKind::NativeStatic => "static library",
835841
NativeLibraryKind::NativeUnknown => "library",

0 commit comments

Comments
 (0)