File tree 1 file changed +20
-0
lines changed
compiler/rustc_session/src
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -2543,6 +2543,26 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
2543
2543
) ;
2544
2544
}
2545
2545
2546
+ // For testing purposes, until we have more feedback about these options: ensure `-Z
2547
+ // unstable-options` is enabled when using the unstable `-C link-self-contained` options.
2548
+ if !debugging_opts. unstable_options {
2549
+ let uses_unstable_self_contained_option =
2550
+ matches. opt_strs ( "C" ) . iter ( ) . any ( |option| match option. as_str ( ) {
2551
+ "link-self-contained=crt"
2552
+ | "link-self-contained=auto"
2553
+ | "link-self-contained=linker"
2554
+ | "link-self-contained=all" => true ,
2555
+ _ => false ,
2556
+ } ) ;
2557
+ if uses_unstable_self_contained_option {
2558
+ early_error (
2559
+ error_format,
2560
+ "only `-C link-self-contained` values `y`/`yes`/`on`/`n`/`no`/`off` are stable, \
2561
+ the `-Z unstable-options` flag must also be passed to use the unstable values",
2562
+ ) ;
2563
+ }
2564
+ }
2565
+
2546
2566
let prints = collect_print_requests ( & mut cg, & mut debugging_opts, matches, error_format) ;
2547
2567
2548
2568
let cg = cg;
You can’t perform that action at this time.
0 commit comments