File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -277,7 +277,7 @@ pub(crate) fn run_aot(
277277 let tmp_file =
278278 tcx. output_filenames ( ( ) ) . temp_path ( OutputType :: Metadata , Some ( & metadata_cgu_name) ) ;
279279
280- let obj = crate :: metadata:: new_metadata_object ( tcx, & metadata_cgu_name) ;
280+ let obj = crate :: metadata:: new_metadata_object ( tcx, & metadata_cgu_name, & metadata ) ;
281281
282282 if let Err ( err) = std:: fs:: write ( & tmp_file, obj) {
283283 tcx. sess . fatal ( & format ! ( "error writing metadata object file: {}" , err) ) ;
Original file line number Diff line number Diff line change 33use object:: write:: { Object , StandardSegment , Symbol , SymbolSection } ;
44use object:: { SectionKind , SymbolFlags , SymbolKind , SymbolScope } ;
55
6+ use rustc_middle:: middle:: cstore:: EncodedMetadata ;
67use rustc_middle:: ty:: TyCtxt ;
78
89// Adapted from https://github.com/rust-lang/rust/blob/da573206f87b5510de4b0ee1a9c044127e409bd3/src/librustc_codegen_llvm/base.rs#L47-L112
9- pub ( crate ) fn new_metadata_object ( tcx : TyCtxt < ' _ > , cgu_name : & str ) -> Vec < u8 > {
10+ pub ( crate ) fn new_metadata_object ( tcx : TyCtxt < ' _ > , cgu_name : & str , metadata : & EncodedMetadata ) -> Vec < u8 > {
1011 use snap:: write:: FrameEncoder ;
1112 use std:: io:: Write ;
1213
13- let metadata = tcx. encode_metadata ( ) ;
1414 let mut compressed = rustc_metadata:: METADATA_HEADER . to_vec ( ) ;
1515 FrameEncoder :: new ( & mut compressed) . write_all ( & metadata. raw_data ) . unwrap ( ) ;
1616
You can’t perform that action at this time.
0 commit comments