@@ -1122,14 +1122,6 @@ pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
11221122pub enum OptionStability {
11231123 Stable ,
11241124
1125- // FIXME: historically there were some options which were either `-Z` or
1126- // required the `-Z unstable-options` flag, which were all intended
1127- // to be unstable. Unfortunately we didn't actually gate usage of
1128- // these options on the stable compiler, so we still allow them there
1129- // today. There are some warnings printed out about this in the
1130- // driver.
1131- UnstableButNotReally ,
1132-
11331125 Unstable ,
11341126}
11351127
@@ -1148,17 +1140,9 @@ impl RustcOptGroup {
11481140 RustcOptGroup { opt_group : g, stability : OptionStability :: Stable }
11491141 }
11501142
1151- #[ allow( dead_code) ] // currently we have no "truly unstable" options
11521143 pub fn unstable ( g : getopts:: OptGroup ) -> RustcOptGroup {
11531144 RustcOptGroup { opt_group : g, stability : OptionStability :: Unstable }
11541145 }
1155-
1156- fn unstable_bnr ( g : getopts:: OptGroup ) -> RustcOptGroup {
1157- RustcOptGroup {
1158- opt_group : g,
1159- stability : OptionStability :: UnstableButNotReally ,
1160- }
1161- }
11621146}
11631147
11641148// The `opt` local module holds wrappers around the `getopts` API that
@@ -1180,7 +1164,6 @@ mod opt {
11801164
11811165 fn stable ( g : getopts:: OptGroup ) -> R { RustcOptGroup :: stable ( g) }
11821166 fn unstable ( g : getopts:: OptGroup ) -> R { RustcOptGroup :: unstable ( g) }
1183- fn unstable_bnr ( g : getopts:: OptGroup ) -> R { RustcOptGroup :: unstable_bnr ( g) }
11841167
11851168 pub fn opt_s ( a : S , b : S , c : S , d : S ) -> R {
11861169 stable ( getopts:: optopt ( a, b, c, d) )
@@ -1213,24 +1196,6 @@ mod opt {
12131196 pub fn flagmulti ( a : S , b : S , c : S ) -> R {
12141197 unstable ( getopts:: optflagmulti ( a, b, c) )
12151198 }
1216-
1217- // Do not use these functions for any new options added to the compiler, all
1218- // new options should use the `*_u` variants above to be truly unstable.
1219- pub fn opt_ubnr ( a : S , b : S , c : S , d : S ) -> R {
1220- unstable_bnr ( getopts:: optopt ( a, b, c, d) )
1221- }
1222- pub fn multi_ubnr ( a : S , b : S , c : S , d : S ) -> R {
1223- unstable_bnr ( getopts:: optmulti ( a, b, c, d) )
1224- }
1225- pub fn flag_ubnr ( a : S , b : S , c : S ) -> R {
1226- unstable_bnr ( getopts:: optflag ( a, b, c) )
1227- }
1228- pub fn flagopt_ubnr ( a : S , b : S , c : S , d : S ) -> R {
1229- unstable_bnr ( getopts:: optflagopt ( a, b, c, d) )
1230- }
1231- pub fn flagmulti_ubnr ( a : S , b : S , c : S ) -> R {
1232- unstable_bnr ( getopts:: optflagmulti ( a, b, c) )
1233- }
12341199}
12351200
12361201/// Returns the "short" subset of the rustc command line options,
@@ -1296,7 +1261,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
12961261 opt:: multi_s ( "" , "extern" , "Specify where an external rust library is located" ,
12971262 "NAME=PATH" ) ,
12981263 opt:: opt_s ( "" , "sysroot" , "Override the system root" , "PATH" ) ,
1299- opt:: multi_ubnr ( "Z" , "" , "Set internal debugging options" , "FLAG" ) ,
1264+ opt:: multi ( "Z" , "" , "Set internal debugging options" , "FLAG" ) ,
13001265 opt:: opt_s ( "" , "error-format" ,
13011266 "How errors and other messages are produced" ,
13021267 "human|json" ) ,
@@ -1305,28 +1270,20 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
13051270 always = always colorize output;
13061271 never = never colorize output" , "auto|always|never" ) ,
13071272
1308- opt:: flagopt_ubnr ( "" , "pretty" ,
1309- "Pretty-print the input instead of compiling;
1310- valid types are: `normal` (un-annotated source),
1311- `expanded` (crates expanded), or
1312- `expanded,identified` (fully parenthesized, AST nodes with IDs)." ,
1313- "TYPE" ) ,
1314- opt:: flagopt_ubnr ( "" , "unpretty" ,
1315- "Present the input source, unstable (and less-pretty) variants;
1316- valid types are any of the types for `--pretty`, as well as:
1317- `flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1318- `everybody_loops` (all function bodies replaced with `loop {}`),
1319- `hir` (the HIR), `hir,identified`, or
1320- `hir,typed` (HIR with types for each node)." ,
1321- "TYPE" ) ,
1322-
1323- // new options here should **not** use the `_ubnr` functions, all new
1324- // unstable options should use the short variants to indicate that they
1325- // are truly unstable. All `_ubnr` flags are just that way because they
1326- // were so historically.
1327- //
1328- // You may also wish to keep this comment at the bottom of this list to
1329- // ensure that others see it.
1273+ opt:: flagopt ( "" , "pretty" ,
1274+ "Pretty-print the input instead of compiling;
1275+ valid types are: `normal` (un-annotated source),
1276+ `expanded` (crates expanded), or
1277+ `expanded,identified` (fully parenthesized, AST nodes with IDs)." ,
1278+ "TYPE" ) ,
1279+ opt:: flagopt ( "" , "unpretty" ,
1280+ "Present the input source, unstable (and less-pretty) variants;
1281+ valid types are any of the types for `--pretty`, as well as:
1282+ `flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1283+ `everybody_loops` (all function bodies replaced with `loop {}`),
1284+ `hir` (the HIR), `hir,identified`, or
1285+ `hir,typed` (HIR with types for each node)." ,
1286+ "TYPE" ) ,
13301287 ] ) ;
13311288 opts
13321289}
@@ -1704,7 +1661,7 @@ pub mod nightly_options {
17041661 use getopts;
17051662 use syntax:: feature_gate:: UnstableFeatures ;
17061663 use super :: { ErrorOutputType , OptionStability , RustcOptGroup } ;
1707- use session:: { early_error, early_warn } ;
1664+ use session:: early_error;
17081665
17091666 pub fn is_unstable_enabled ( matches : & getopts:: Matches ) -> bool {
17101667 is_nightly_build ( ) && matches. opt_strs ( "Z" ) . iter ( ) . any ( |x| * x == "unstable-options" )
@@ -1746,15 +1703,6 @@ pub mod nightly_options {
17461703 nightly compiler", opt_name) ;
17471704 early_error ( ErrorOutputType :: default ( ) , & msg) ;
17481705 }
1749- OptionStability :: UnstableButNotReally => {
1750- let msg = format ! ( "the option `{}` is unstable and should \
1751- only be used on the nightly compiler, but \
1752- it is currently accepted for backwards \
1753- compatibility; this will soon change, \
1754- see issue #31847 for more details",
1755- opt_name) ;
1756- early_warn ( ErrorOutputType :: default ( ) , & msg) ;
1757- }
17581706 OptionStability :: Stable => { }
17591707 }
17601708 }
0 commit comments