@@ -414,6 +414,7 @@ and cli_options_of_json (ctx : of_json_ctx) (js : json) :
414414 (" skip_borrowck" , skip_borrowck);
415415 (" mir" , mir);
416416 (" rustc_args" , rustc_args);
417+ (" targets" , targets);
417418 (" monomorphize" , monomorphize);
418419 (" monomorphize_mut" , monomorphize_mut);
419420 (" start_from" , start_from);
@@ -456,6 +457,7 @@ and cli_options_of_json (ctx : of_json_ctx) (js : json) :
456457 let * skip_borrowck = bool_of_json ctx skip_borrowck in
457458 let * mir = option_of_json mir_level_of_json ctx mir in
458459 let * rustc_args = list_of_json string_of_json ctx rustc_args in
460+ let * targets = list_of_json string_of_json ctx targets in
459461 let * monomorphize = bool_of_json ctx monomorphize in
460462 let * monomorphize_mut =
461463 option_of_json monomorphize_mut_of_json ctx monomorphize_mut
@@ -515,6 +517,7 @@ and cli_options_of_json (ctx : of_json_ctx) (js : json) :
515517 skip_borrowck;
516518 mir;
517519 rustc_args;
520+ targets;
518521 monomorphize;
519522 monomorphize_mut;
520523 start_from;
@@ -1006,17 +1009,17 @@ and generic_args_of_json (ctx : of_json_ctx) (js : json) :
10061009 (" trait_refs" , trait_refs);
10071010 ] ->
10081011 let * regions =
1009- index_map_of_json region_id_of_json region_of_json ctx regions
1012+ indexed_map_of_json region_id_of_json region_of_json ctx regions
10101013 in
10111014 let * types =
1012- index_map_of_json type_var_id_of_json ty_of_json ctx types
1015+ indexed_map_of_json type_var_id_of_json ty_of_json ctx types
10131016 in
10141017 let * const_generics =
1015- index_map_of_json const_generic_var_id_of_json constant_expr_of_json
1018+ indexed_map_of_json const_generic_var_id_of_json constant_expr_of_json
10161019 ctx const_generics
10171020 in
10181021 let * trait_refs =
1019- index_map_of_json trait_clause_id_of_json trait_ref_of_json ctx
1022+ indexed_map_of_json trait_clause_id_of_json trait_ref_of_json ctx
10201023 trait_refs
10211024 in
10221025 Ok ({ regions; types; const_generics; trait_refs } : generic_args )
@@ -1037,17 +1040,17 @@ and generic_params_of_json (ctx : of_json_ctx) (js : json) :
10371040 (" trait_type_constraints" , trait_type_constraints);
10381041 ] ->
10391042 let * regions =
1040- index_map_of_json region_id_of_json region_param_of_json ctx regions
1043+ indexed_map_of_json region_id_of_json region_param_of_json ctx regions
10411044 in
10421045 let * types =
1043- index_map_of_json type_var_id_of_json type_param_of_json ctx types
1046+ indexed_map_of_json type_var_id_of_json type_param_of_json ctx types
10441047 in
10451048 let * const_generics =
1046- index_map_of_json const_generic_var_id_of_json
1049+ indexed_map_of_json const_generic_var_id_of_json
10471050 const_generic_param_of_json ctx const_generics
10481051 in
10491052 let * trait_clauses =
1050- index_map_of_json trait_clause_id_of_json trait_param_of_json ctx
1053+ indexed_map_of_json trait_clause_id_of_json trait_param_of_json ctx
10511054 trait_clauses
10521055 in
10531056 let * regions_outlive =
@@ -1063,7 +1066,7 @@ and generic_params_of_json (ctx : of_json_ctx) (js : json) :
10631066 ctx types_outlive
10641067 in
10651068 let * trait_type_constraints =
1066- index_map_of_json trait_type_constraint_id_of_json
1069+ indexed_map_of_json trait_type_constraint_id_of_json
10671070 (region_binder_of_json trait_type_constraint_of_json)
10681071 ctx trait_type_constraints
10691072 in
@@ -1156,7 +1159,7 @@ and impl_elem_of_json (ctx : of_json_ctx) (js : json) :
11561159 Ok (ImplElemTrait trait)
11571160 | _ -> Error " " )
11581161
1159- and index_map_of_json :
1162+ and indexed_map_of_json :
11601163 'a0 'a1 .
11611164 (of_json_ctx -> json -> ('a0 , string ) result ) ->
11621165 (of_json_ctx -> json -> ('a1 , string ) result ) ->
@@ -1171,6 +1174,21 @@ and index_map_of_json :
11711174 Ok (List. filter_map (fun x -> x) list )
11721175 | _ -> Error " " )
11731176
1177+ and index_map_of_json :
1178+ 'a0 'a1 'a2 .
1179+ (of_json_ctx -> json -> ('a0 , string ) result ) ->
1180+ (of_json_ctx -> json -> ('a1 , string ) result ) ->
1181+ (of_json_ctx -> json -> ('a2 , string ) result ) ->
1182+ of_json_ctx ->
1183+ json ->
1184+ (('a0 * 'a1 ) list , string ) result =
1185+ fun arg0_of_json arg1_of_json arg2_of_json ctx js ->
1186+ combine_error_msgs js __FUNCTION__
1187+ (match js with
1188+ | json ->
1189+ list_of_json (key_value_pair_of_json arg0_of_json arg1_of_json) ctx json
1190+ | _ -> Error " " )
1191+
11741192and index_vec_of_json :
11751193 'a0 'a1 .
11761194 (of_json_ctx -> json -> ('a0 , string ) result ) ->
@@ -1314,7 +1332,7 @@ and item_source_of_json (ctx : of_json_ctx) (js : json) :
13141332 index_vec_of_json field_id_of_json v_table_field_of_json ctx field_map
13151333 in
13161334 let * supertrait_map =
1317- index_map_of_json trait_clause_id_of_json
1335+ indexed_map_of_json trait_clause_id_of_json
13181336 (option_of_json field_id_of_json)
13191337 ctx supertrait_map
13201338 in
@@ -1538,6 +1556,9 @@ and path_elem_of_json (ctx : of_json_ctx) (js : json) :
15381556 box_of_json (binder_of_json generic_args_of_json) ctx instantiated
15391557 in
15401558 Ok (PeInstantiated instantiated)
1559+ | `Assoc [ (" Target" , target) ] ->
1560+ let * target = string_of_json ctx target in
1561+ Ok (PeTarget target)
15411562 | _ -> Error " " )
15421563
15431564and place_of_json (ctx : of_json_ctx ) (js : json ) : (place, string) result =
@@ -1671,7 +1692,7 @@ and region_binder_of_json :
16711692 (match js with
16721693 | `Assoc [ (" regions" , regions); (" skip_binder" , skip_binder) ] ->
16731694 let * binder_regions =
1674- index_map_of_json region_id_of_json region_param_of_json ctx regions
1695+ indexed_map_of_json region_id_of_json region_param_of_json ctx regions
16751696 in
16761697 let * binder_value = arg0_of_json ctx skip_binder in
16771698 Ok ({ binder_regions; binder_value } : _ region_binder )
@@ -1884,7 +1905,7 @@ and trait_assoc_ty_of_json (ctx : of_json_ctx) (js : json) :
18841905 let * attr_info = attr_info_of_json ctx attr_info in
18851906 let * default = option_of_json trait_assoc_ty_impl_of_json ctx default in
18861907 let * implied_clauses =
1887- index_map_of_json trait_clause_id_of_json trait_param_of_json ctx
1908+ indexed_map_of_json trait_clause_id_of_json trait_param_of_json ctx
18881909 implied_clauses
18891910 in
18901911 Ok ({ name; attr_info; default; implied_clauses } : trait_assoc_ty )
@@ -1925,7 +1946,7 @@ and trait_decl_of_json (ctx : of_json_ctx) (js : json) :
19251946 let * item_meta = item_meta_of_json ctx item_meta in
19261947 let * generics = generic_params_of_json ctx generics in
19271948 let * implied_clauses =
1928- index_map_of_json trait_clause_id_of_json trait_param_of_json ctx
1949+ indexed_map_of_json trait_clause_id_of_json trait_param_of_json ctx
19291950 implied_clauses
19301951 in
19311952 let * consts = list_of_json trait_assoc_const_of_json ctx consts in
@@ -1988,7 +2009,7 @@ and trait_impl_of_json (ctx : of_json_ctx) (js : json) :
19882009 let * impl_trait = trait_decl_ref_of_json ctx impl_trait in
19892010 let * generics = generic_params_of_json ctx generics in
19902011 let * implied_trait_refs =
1991- index_map_of_json trait_clause_id_of_json trait_ref_of_json ctx
2012+ indexed_map_of_json trait_clause_id_of_json trait_ref_of_json ctx
19922013 implied_trait_refs
19932014 in
19942015 let * consts =
@@ -2131,7 +2152,7 @@ and trait_ref_kind_of_json (ctx : of_json_ctx) (js : json) :
21312152 ] ->
21322153 let * builtin_data = builtin_impl_data_of_json ctx builtin_data in
21332154 let * parent_trait_refs =
2134- index_map_of_json trait_clause_id_of_json trait_ref_of_json ctx
2155+ indexed_map_of_json trait_clause_id_of_json trait_ref_of_json ctx
21352156 parent_trait_refs
21362157 in
21372158 let * types =
@@ -2244,7 +2265,9 @@ and type_decl_of_json (ctx : of_json_ctx) (js : json) :
22442265 let * generics = generic_params_of_json ctx generics in
22452266 let * src = item_source_of_json ctx src in
22462267 let * kind = type_decl_kind_of_json ctx kind in
2247- let * layout = option_of_json layout_of_json ctx layout in
2268+ let * layout =
2269+ index_map_of_json string_of_json layout_of_json int_of_json ctx layout
2270+ in
22482271 let * ptr_metadata = ptr_metadata_of_json ctx ptr_metadata in
22492272 let * repr = option_of_json repr_options_of_json ctx repr in
22502273 Ok
0 commit comments