@@ -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
@@ -1104,13 +1117,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
1104
1117
"write syntax and type analysis (in JSON format) information, in \
1105
1118
addition to normal output") ,
1106
1119
flowgraph_print_loans: bool = ( false , parse_bool, [ UNTRACKED ] ,
1107
- "include loan analysis data in -- unpretty flowgraph output" ) ,
1120
+ "include loan analysis data in -Z unpretty flowgraph output" ) ,
1108
1121
flowgraph_print_moves: bool = ( false , parse_bool, [ UNTRACKED ] ,
1109
- "include move analysis data in -- unpretty flowgraph output" ) ,
1122
+ "include move analysis data in -Z unpretty flowgraph output" ) ,
1110
1123
flowgraph_print_assigns: bool = ( false , parse_bool, [ UNTRACKED ] ,
1111
- "include assignment analysis data in -- unpretty flowgraph output" ) ,
1124
+ "include assignment analysis data in -Z unpretty flowgraph output" ) ,
1112
1125
flowgraph_print_all: bool = ( false , parse_bool, [ UNTRACKED ] ,
1113
- "include all dataflow analysis data in -- unpretty flowgraph output" ) ,
1126
+ "include all dataflow analysis data in -Z unpretty flowgraph output" ) ,
1114
1127
print_region_graph: bool = ( false , parse_bool, [ UNTRACKED ] ,
1115
1128
"prints region inference graph. \
1116
1129
Use with RUST_REGION_GRAPH=help for more info") ,
@@ -1241,6 +1254,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
1241
1254
dep_info_omit_d_target: bool = ( false , parse_bool, [ TRACKED ] ,
1242
1255
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
1243
1256
themselves") ,
1257
+ unpretty: Option <String > = ( None , parse_unpretty, [ UNTRACKED ] ,
1258
+ "Present the input source, unstable (and less-pretty) variants;
1259
+ valid types are any of the types for `--pretty`, as well as:
1260
+ `flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1261
+ `everybody_loops` (all function bodies replaced with `loop {}`),
1262
+ `hir` (the HIR), `hir,identified`, or
1263
+ `hir,typed` (HIR with types for each node)." ) ,
1244
1264
}
1245
1265
1246
1266
pub fn default_lib_output ( ) -> CrateType {
@@ -1514,14 +1534,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
1514
1534
`expanded` (crates expanded), or
1515
1535
`expanded,identified` (fully parenthesized, AST nodes with IDs)." ,
1516
1536
"TYPE" ) ,
1517
- opt:: opt( "" , "unpretty" ,
1518
- "Present the input source, unstable (and less-pretty) variants;
1519
- valid types are any of the types for `--pretty`, as well as:
1520
- `flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
1521
- `everybody_loops` (all function bodies replaced with `loop {}`),
1522
- `hir` (the HIR), `hir,identified`, or
1523
- `hir,typed` (HIR with types for each node)." ,
1524
- "TYPE" ) ,
1525
1537
] ) ;
1526
1538
opts
1527
1539
}
0 commit comments