@@ -11,7 +11,7 @@ module Thir = struct
11
11
type generic_param_kind = generic_param_kind_for__decorated_for__expr_kind
12
12
type trait_item = trait_item_for__decorated_for__expr_kind
13
13
type ty = node_for__ty_kind
14
- type item_ref = unboxed_item_ref
14
+ type item_ref = node_for__item_ref_contents
15
15
type trait_ref = item_ref
16
16
end
17
17
@@ -514,8 +514,14 @@ end) : EXPR = struct
514
514
let f = c_expr fun' in
515
515
match fun'.contents with
516
516
| GlobalName
517
- { item = { def_id = id; generic_args; impl_exprs; in_trait }; _ }
518
- ->
517
+ {
518
+ item =
519
+ {
520
+ value = { def_id = id; generic_args; impl_exprs; in_trait };
521
+ _;
522
+ };
523
+ _;
524
+ } ->
519
525
let f = { f with e = GlobalVar (def_id ~value: true id) } in
520
526
let bounds_impls = List. map ~f: (c_impl_expr e.span) impl_exprs in
521
527
let generic_args =
@@ -637,7 +643,8 @@ end) : EXPR = struct
637
643
trait = None (* TODO: see issue #328 *) ;
638
644
bounds_impls = [] ;
639
645
}
640
- | GlobalName { item = { def_id = id ; _ } ; constructor = _ } ->
646
+ | GlobalName { item = { value = { def_id = id; _ }; _ }; constructor = _ }
647
+ ->
641
648
GlobalVar (def_id ~value: true id)
642
649
| UpvarRef { var_hir_id = id ; _ } -> LocalVar (local_ident Expr id)
643
650
| Borrow { arg; borrow_kind = kind } ->
@@ -726,7 +733,11 @@ end) : EXPR = struct
726
733
})
727
734
l))
728
735
| NamedConst
729
- { item = { def_id = id; generic_args; in_trait = impl; _ }; _ } ->
736
+ {
737
+ item =
738
+ { value = { def_id = id; generic_args; in_trait = impl; _ }; _ };
739
+ _;
740
+ } ->
730
741
let f = GlobalVar (def_id ~value: true id) in
731
742
let args = List. map ~f: (c_generic_value e.span) generic_args in
732
743
let const_args =
@@ -1025,7 +1036,7 @@ end) : EXPR = struct
1025
1036
else List. map ~f: (c_ty span) inputs
1026
1037
in
1027
1038
TArrow (inputs, c_ty span output)
1028
- | Adt { def_id = id ; generic_args; _ } ->
1039
+ | Adt { value = { def_id = id ; generic_args; _ } ; _ } ->
1029
1040
let ident = def_id ~value: false id in
1030
1041
let args = List. map ~f: (c_generic_value span) generic_args in
1031
1042
TApp { ident; args }
@@ -1110,15 +1121,15 @@ end) : EXPR = struct
1110
1121
let goal = c_trait_ref span ie.trait.value in
1111
1122
let impl = { kind = c_impl_expr_atom span ie.impl; goal } in
1112
1123
match ie.impl with
1113
- | Concrete { impl_exprs = [] ; _ } -> impl
1114
- | Concrete { impl_exprs; _ } ->
1124
+ | Concrete { value = { impl_exprs = [] ; _ } ; _ } -> impl
1125
+ | Concrete { value = { impl_exprs; _ } ; _ } ->
1115
1126
let args = List. map ~f: (c_impl_expr span) impl_exprs in
1116
1127
{ kind = ImplApp { impl; args }; goal }
1117
1128
| _ -> impl
1118
1129
1119
1130
and c_trait_ref span (tr : Thir.trait_ref ) : trait_goal =
1120
- let trait = Concrete_ident. of_def_id ~value: false tr.def_id in
1121
- let args = List. map ~f: (c_generic_value span) tr.generic_args in
1131
+ let trait = Concrete_ident. of_def_id ~value: false tr.value. def_id in
1132
+ let args = List. map ~f: (c_generic_value span) tr.value. generic_args in
1122
1133
{ trait; args }
1123
1134
1124
1135
and c_impl_expr_atom (span : Thir.span ) (ie : Thir.impl_expr_atom ) :
@@ -1132,7 +1143,7 @@ end) : EXPR = struct
1132
1143
let ident =
1133
1144
{ goal = c_trait_ref span trait_ref; name = predicate_id }
1134
1145
in
1135
- let item = Concrete_ident. of_def_id ~value: false item.def_id in
1146
+ let item = Concrete_ident. of_def_id ~value: false item.value. def_id in
1136
1147
let trait_ref = c_trait_ref span trait_ref in
1137
1148
Projection
1138
1149
{ impl = { kind = item_kind; goal = trait_ref }; ident; item }
@@ -1145,7 +1156,7 @@ end) : EXPR = struct
1145
1156
Parent { impl = { kind = item_kind; goal = trait_ref }; ident }
1146
1157
in
1147
1158
match ie with
1148
- | Concrete { def_id; generic_args; _ } ->
1159
+ | Concrete { value = { def_id; generic_args; _ } ; _ } ->
1149
1160
let trait = Concrete_ident. of_def_id ~value: false def_id in
1150
1161
let args = List. map ~f: (c_generic_value span) generic_args in
1151
1162
Concrete { trait; args }
@@ -1242,8 +1253,12 @@ end) : EXPR = struct
1242
1253
generic_constraint option =
1243
1254
match kind with
1244
1255
| Trait { is_positive = true ; trait_ref } ->
1245
- let args = List. map ~f: (c_generic_value span) trait_ref.generic_args in
1246
- let trait = Concrete_ident. of_def_id ~value: false trait_ref.def_id in
1256
+ let args =
1257
+ List. map ~f: (c_generic_value span) trait_ref.value.generic_args
1258
+ in
1259
+ let trait =
1260
+ Concrete_ident. of_def_id ~value: false trait_ref.value.def_id
1261
+ in
1247
1262
Some (GCType { goal = { trait; args }; name = id })
1248
1263
| Projection { impl_expr; assoc_item; ty } ->
1249
1264
let impl = c_impl_expr span impl_expr in
@@ -1770,9 +1785,10 @@ and c_item_unwrapped ~ident ~type_only (item : Thir.item) : item list =
1770
1785
generics = c_generics generics;
1771
1786
self_ty = c_ty item.span self_ty;
1772
1787
of_trait =
1773
- ( Concrete_ident. of_def_id ~value: false of_trait.def_id,
1774
- List. map ~f: (c_generic_value item.span) of_trait.generic_args
1775
- );
1788
+ ( Concrete_ident. of_def_id ~value: false of_trait.value.def_id,
1789
+ List. map
1790
+ ~f: (c_generic_value item.span)
1791
+ of_trait.value.generic_args );
1776
1792
items;
1777
1793
parent_bounds =
1778
1794
List. filter_map
0 commit comments