This repository was archived by the owner on May 28, 2025. It is now read-only.
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(
277
277
let tmp_file =
278
278
tcx. output_filenames ( ( ) ) . temp_path ( OutputType :: Metadata , Some ( & metadata_cgu_name) ) ;
279
279
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 ) ;
281
281
282
282
if let Err ( err) = std:: fs:: write ( & tmp_file, obj) {
283
283
tcx. sess . fatal ( & format ! ( "error writing metadata object file: {}" , err) ) ;
Original file line number Diff line number Diff line change 3
3
use object:: write:: { Object , StandardSegment , Symbol , SymbolSection } ;
4
4
use object:: { SectionKind , SymbolFlags , SymbolKind , SymbolScope } ;
5
5
6
+ use rustc_middle:: middle:: cstore:: EncodedMetadata ;
6
7
use rustc_middle:: ty:: TyCtxt ;
7
8
8
9
// 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 > {
10
11
use snap:: write:: FrameEncoder ;
11
12
use std:: io:: Write ;
12
13
13
- let metadata = tcx. encode_metadata ( ) ;
14
14
let mut compressed = rustc_metadata:: METADATA_HEADER . to_vec ( ) ;
15
15
FrameEncoder :: new ( & mut compressed) . write_all ( & metadata. raw_data ) . unwrap ( ) ;
16
16
You can’t perform that action at this time.
0 commit comments