Skip to content

Commit 1ba50c2

Browse files
committed
Fix metadata method call - use stub_or_full() instead of raw_bytes()
1 parent fdfbb56 commit 1ba50c2

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

  • crates/rustc_codegen_nvvm/src

crates/rustc_codegen_nvvm/src/link.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,12 @@ pub fn link(
137137
out_filename.file_for_writing(outputs, OutputType::Exe, "", None);
138138
match crate_type {
139139
CrateType::Rlib => {
140-
link_rlib(sess, codegen_results, &out_filename_file_for_writing, &metadata);
140+
link_rlib(
141+
sess,
142+
codegen_results,
143+
&out_filename_file_for_writing,
144+
&metadata,
145+
);
141146
}
142147
CrateType::Executable | CrateType::Cdylib | CrateType::Dylib => {
143148
let _ = link_exe(
@@ -154,7 +159,12 @@ pub fn link(
154159
}
155160
}
156161

157-
fn link_rlib(sess: &Session, codegen_results: &CodegenResults, out_filename: &Path, metadata: &rustc_metadata::EncodedMetadata) {
162+
fn link_rlib(
163+
sess: &Session,
164+
codegen_results: &CodegenResults,
165+
out_filename: &Path,
166+
metadata: &rustc_metadata::EncodedMetadata,
167+
) {
158168
debug!("Linking rlib `{:?}`", out_filename);
159169
let mut file_list = Vec::<&Path>::new();
160170

@@ -185,12 +195,7 @@ fn link_rlib(sess: &Session, codegen_results: &CodegenResults, out_filename: &Pa
185195
}
186196
trace!("Files linked in rlib:\n{:#?}", file_list);
187197

188-
create_archive(
189-
sess,
190-
&file_list,
191-
metadata.raw_bytes(),
192-
out_filename,
193-
);
198+
create_archive(sess, &file_list, metadata.stub_or_full(), out_filename);
194199
}
195200

196201
fn link_exe(

0 commit comments

Comments
 (0)