File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -2537,6 +2537,8 @@ written to standard error output)"),
25372537 by the linker" ) ,
25382538 split_lto_unit: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
25392539 "enable LTO unit splitting (default: no)" ) ,
2540+ split_rmeta: Option <bool > = ( None , parse_opt_bool, [ TRACKED ] ,
2541+ "split extra rmeta data that isn't relevant rlib ABI into a separate file" ) ,
25402542 src_hash_algorithm: Option <SourceFileHashAlgorithm > = ( None , parse_src_file_hash, [ TRACKED ] ,
25412543 "hash algorithm of source files in debug info (`md5`, `sha1`, or `sha256`)" ) ,
25422544 #[ rustc_lint_opt_deny_field_access( "use `Session::stack_protector` instead of this field" ) ]
Original file line number Diff line number Diff line change @@ -400,6 +400,10 @@ impl Session {
400400 self . opts . unstable_opts . split_lto_unit == Some ( true )
401401 }
402402
403+ pub fn is_split_rmeta_enabled ( & self ) -> bool {
404+ self . opts . unstable_opts . split_rmeta == Some ( true )
405+ }
406+
403407 /// Check whether this compile session and crate type use static crt.
404408 pub fn crt_static ( & self , crate_type : Option < CrateType > ) -> bool {
405409 if !self . target . crt_static_respected {
Original file line number Diff line number Diff line change 1- // tests that changing the content of a comment will cause a change in the rmeta of a file
1+ // tests that changing the content of a comment will not cause a change in the rmeta of a library if -Zsplit-rmeta is enabled
22use run_make_support:: { rfs, rustc} ;
33use std:: hash:: { Hash , Hasher } ;
44use std:: path:: Path ;
@@ -7,15 +7,15 @@ fn main() {
77 let before = check_and_hash ( "before.rs" ) ;
88 let after = check_and_hash ( "after.rs" ) ;
99 dbg ! ( before, after) ;
10- assert_neq ! ( before, after) ;
10+ assert_eq ! ( before, after) ;
1111}
1212
1313fn check_and_hash < P > ( filename : P ) -> u64
1414where
1515 P : AsRef < Path > ,
1616{
1717 rfs:: rename ( filename, "foo.rs" ) ;
18- rustc ( ) . input ( "foo.rs" ) . emit ( "metadata" ) . run ( ) ;
18+ rustc ( ) . input ( "foo.rs" ) . emit ( "metadata" ) . arg ( "-Zsplit-rmeta" ) . run ( ) ;
1919 // hash the output
2020 let bytes = rfs:: read ( "libfoo.rmeta" ) ;
2121 let mut hasher = std:: hash:: DefaultHasher :: new ( ) ;
You can’t perform that action at this time.
0 commit comments