@@ -611,7 +611,7 @@ macro_rules! options {
611611 $parse: ident,
612612 [ $dep_tracking_marker: ident $( $tmod: ident ) ?] ,
613613 $desc: expr
614- $( , deprecated_do_nothing : $dnn: literal ) ?)
614+ $( , is_deprecated_and_do_nothing : $dnn: literal ) ?)
615615 ) ,* , ) =>
616616(
617617 #[ derive( Clone ) ]
@@ -758,6 +758,11 @@ fn build_options<O: Default>(
758758 }
759759 if !setter ( & mut op, value) {
760760 match value {
761+ _ if * type_desc == desc:: parse_error => early_dcx. early_fatal (
762+ format ! (
763+ "{outputname} option `{key}` has been removed"
764+ ) ,
765+ ) ,
761766 None => early_dcx. early_fatal (
762767 format ! (
763768 "{outputname} option `{key}` requires {type_desc} ({prefix} {key}=<value>)"
@@ -783,6 +788,7 @@ fn build_options<O: Default>(
783788
784789#[ allow( non_upper_case_globals) ]
785790mod desc {
791+ pub ( crate ) const parse_error: & str = "<removed>" ;
786792 pub ( crate ) const parse_no_value: & str = "no value" ;
787793 pub ( crate ) const parse_bool: & str =
788794 "one of: `y`, `yes`, `on`, `true`, `n`, `no`, `off` or `false`" ;
@@ -889,6 +895,11 @@ pub mod parse {
889895 pub ( crate ) use super :: * ;
890896 pub ( crate ) const MAX_THREADS_CAP : usize = 256 ;
891897
898+ /// THis is always an error. Used for removed options.
899+ pub ( crate ) fn parse_error ( _slot : & mut ( ) , _v : Option < & str > ) -> bool {
900+ false
901+ }
902+
892903 /// This is for boolean options that don't take a value, and are true simply
893904 /// by existing on the command-line.
894905 ///
@@ -2059,7 +2070,7 @@ options! {
20592070 #[ rustc_lint_opt_deny_field_access( "documented to do nothing" ) ]
20602071 ar: String = ( String :: new( ) , parse_string, [ UNTRACKED ] ,
20612072 "this option is deprecated and does nothing" ,
2062- deprecated_do_nothing : true ) ,
2073+ is_deprecated_and_do_nothing : true ) ,
20632074 #[ rustc_lint_opt_deny_field_access( "use `Session::code_model` instead of this field" ) ]
20642075 code_model: Option <CodeModel > = ( None , parse_code_model, [ TRACKED ] ,
20652076 "choose the code model to use (`rustc --print code-models` for details)" ) ,
@@ -2098,7 +2109,7 @@ options! {
20982109 inline_threshold: Option <u32 > = ( None , parse_opt_number, [ UNTRACKED ] ,
20992110 "this option is deprecated and does nothing \
21002111 (consider using `-Cllvm-args=--inline-threshold=...`)",
2101- deprecated_do_nothing : true ) ,
2112+ is_deprecated_and_do_nothing : true ) ,
21022113 #[ rustc_lint_opt_deny_field_access( "use `Session::instrument_coverage` instead of this field" ) ]
21032114 instrument_coverage: InstrumentCoverage = ( InstrumentCoverage :: No , parse_instrument_coverage, [ TRACKED ] ,
21042115 "instrument the generated code to support LLVM source-based code coverage reports \
@@ -2139,7 +2150,7 @@ options! {
21392150 #[ rustc_lint_opt_deny_field_access( "documented to do nothing" ) ]
21402151 no_stack_check: bool = ( false , parse_no_value, [ UNTRACKED ] ,
21412152 "this option is deprecated and does nothing" ,
2142- deprecated_do_nothing : true ) ,
2153+ is_deprecated_and_do_nothing : true ) ,
21432154 no_vectorize_loops: bool = ( false , parse_no_value, [ TRACKED ] ,
21442155 "disable loop vectorization optimization passes" ) ,
21452156 no_vectorize_slp: bool = ( false , parse_no_value, [ TRACKED ] ,
@@ -2173,8 +2184,10 @@ options! {
21732184 "set rpath values in libs/exes (default: no)" ) ,
21742185 save_temps: bool = ( false , parse_bool, [ UNTRACKED ] ,
21752186 "save all temporary output files during compilation (default: no)" ) ,
2176- soft_float: bool = ( false , parse_bool, [ TRACKED ] ,
2177- "deprecated option: use soft float ABI (*eabihf targets only) (default: no)" ) ,
2187+ #[ rustc_lint_opt_deny_field_access( "documented to do nothing" ) ]
2188+ soft_float: ( ) = ( ( ) , parse_error, [ UNTRACKED ] ,
2189+ "this option is deprecated and does nothing \
2190+ (use a corresponding *eabi target instead)") ,
21782191 #[ rustc_lint_opt_deny_field_access( "use `Session::split_debuginfo` instead of this field" ) ]
21792192 split_debuginfo: Option <SplitDebuginfo > = ( None , parse_split_debuginfo, [ TRACKED ] ,
21802193 "how to handle split-debuginfo, a platform-specific option" ) ,
0 commit comments