@@ -778,6 +778,8 @@ macro_rules! options {
778
778
Some ( :: rustc_back:: LinkerFlavor :: one_of( ) ) ;
779
779
pub const parse_optimization_fuel: Option <& ' static str > =
780
780
Some ( "crate=integer" ) ;
781
+ pub const parse_unpretty: Option <& ' static str > =
782
+ Some ( "`string` or `string=string`" ) ;
781
783
}
782
784
783
785
#[ allow( dead_code) ]
@@ -965,6 +967,17 @@ macro_rules! options {
965
967
}
966
968
}
967
969
}
970
+
971
+ fn parse_unpretty( slot: & mut Option <String >, v: Option <& str >) -> bool {
972
+ match v {
973
+ None => false ,
974
+ Some ( s) if s. split( '=' ) . count( ) <= 2 => {
975
+ * slot = Some ( s. to_string( ) ) ;
976
+ true
977
+ }
978
+ _ => false ,
979
+ }
980
+ }
968
981
}
969
982
) }
970
983
@@ -1102,13 +1115,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
1102
1115
"write syntax and type analysis (in JSON format) information, in \
1103
1116
addition to normal output") ,
1104
1117
flowgraph_print_loans: bool = ( false , parse_bool, [ UNTRACKED ] ,
1105
- "include loan analysis data in -- unpretty flowgraph output" ) ,
1118
+ "include loan analysis data in -Z unpretty flowgraph output" ) ,
1106
1119
flowgraph_print_moves: bool = ( false , parse_bool, [ UNTRACKED ] ,
1107
- "include move analysis data in -- unpretty flowgraph output" ) ,
1120
+ "include move analysis data in -Z unpretty flowgraph output" ) ,
1108
1121
flowgraph_print_assigns: bool = ( false , parse_bool, [ UNTRACKED ] ,
1109
- "include assignment analysis data in -- unpretty flowgraph output" ) ,
1122
+ "include assignment analysis data in -Z unpretty flowgraph output" ) ,
1110
1123
flowgraph_print_all: bool = ( false , parse_bool, [ UNTRACKED ] ,
1111
- "include all dataflow analysis data in -- unpretty flowgraph output" ) ,
1124
+ "include all dataflow analysis data in -Z unpretty flowgraph output" ) ,
1112
1125
print_region_graph: bool = ( false , parse_bool, [ UNTRACKED ] ,
1113
1126
"prints region inference graph. \
1114
1127
Use with RUST_REGION_GRAPH=help for more info") ,
@@ -1239,6 +1252,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
1239
1252
dep_info_omit_d_target: bool = ( false , parse_bool, [ TRACKED ] ,
1240
1253
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
1241
1254
themselves") ,
1255
+ unpretty: Option <String > = ( None , parse_unpretty, [ UNTRACKED ] ,
1256
+ "Present the input source, unstable (and less-pretty) variants;
1257
+ valid types are any of the types for `--pretty`, as well as:
1258
+ `flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1259
+ `everybody_loops` (all function bodies replaced with `loop {}`),
1260
+ `hir` (the HIR), `hir,identified`, or
1261
+ `hir,typed` (HIR with types for each node)." ) ,
1242
1262
}
1243
1263
1244
1264
pub fn default_lib_output ( ) -> CrateType {
@@ -1512,14 +1532,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
1512
1532
`expanded` (crates expanded), or
1513
1533
`expanded,identified` (fully parenthesized, AST nodes with IDs)." ,
1514
1534
"TYPE" ) ,
1515
- opt:: opt( "" , "unpretty" ,
1516
- "Present the input source, unstable (and less-pretty) variants;
1517
- valid types are any of the types for `--pretty`, as well as:
1518
- `flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1519
- `everybody_loops` (all function bodies replaced with `loop {}`),
1520
- `hir` (the HIR), `hir,identified`, or
1521
- `hir,typed` (HIR with types for each node)." ,
1522
- "TYPE" ) ,
1523
1535
] ) ;
1524
1536
opts
1525
1537
}
0 commit comments