summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--compiler/ExtractBuiltin.ml32
1 files changed, 24 insertions, 8 deletions
diff --git a/compiler/ExtractBuiltin.ml b/compiler/ExtractBuiltin.ml
index 8fcdea56..afa0dd6f 100644
--- a/compiler/ExtractBuiltin.ml
+++ b/compiler/ExtractBuiltin.ml
@@ -528,12 +528,18 @@ module SimpleNamePairMap = Collections.MakeMap (SimpleNamePairOrd)
let builtin_trait_impls_info () :
((string list * string list) * (bool list option * string)) list =
- let fmt (type_name : string list) (trait_name : string list)
- ?(filter : bool list option = None) () :
+ let fmt (type_name : string list)
+ ?(extract_type_name : string list option = None)
+ (trait_name : string list) ?(filter : bool list option = None) () :
(string list * string list) * (bool list option * string) =
let name =
let trait_name = String.concat "" trait_name ^ "Inst" in
let sep = backend_choice "_" "." in
+ let type_name =
+ match extract_type_name with
+ | Some type_name -> type_name
+ | None -> type_name
+ in
String.concat sep type_name ^ sep ^ trait_name
in
((type_name, trait_name), (filter, name))
@@ -547,8 +553,15 @@ let builtin_trait_impls_info () :
(* core::ops::index::Index<[T], I> *)
fmt
[ "core"; "slice"; "index"; "[T]" ]
+ ~extract_type_name:(Some [ "core"; "slice"; "index"; "Slice" ])
[ "core"; "ops"; "index"; "Index" ]
();
+ (* core::ops::index::IndexMut<[T], I> *)
+ fmt
+ [ "core"; "slice"; "index"; "[T]" ]
+ ~extract_type_name:(Some [ "core"; "slice"; "index"; "Slice" ])
+ [ "core"; "ops"; "index"; "IndexMut" ]
+ ();
(* core::slice::index::private_slice_index::Sealed<Range<usize>> *)
fmt
[ "core"; "slice"; "index"; "private_slice_index"; "Range" ]
@@ -559,15 +572,18 @@ let builtin_trait_impls_info () :
[ "core"; "slice"; "index"; "Range" ]
[ "core"; "slice"; "index"; "SliceIndex" ]
();
- (* core::ops::index::IndexMut<[T], I> *)
+ (* core::ops::index::Index<[T; N], I> *)
fmt
- [ "core"; "slice"; "index"; "[T]" ]
- [ "core"; "ops"; "index"; "IndexMut" ]
+ [ "core"; "array"; "[T; N]" ]
+ ~extract_type_name:(Some [ "core"; "array"; "Array" ])
+ [ "core"; "ops"; "index"; "Index" ]
();
- (* core::ops::index::Index<[T; N], I> *)
- fmt [ "core"; "array"; "[T; N]" ] [ "core"; "ops"; "index"; "Index" ] ();
(* core::ops::index::IndexMut<[T; N], I> *)
- fmt [ "core"; "array"; "[T; N]" ] [ "core"; "ops"; "index"; "IndexMut" ] ();
+ fmt
+ [ "core"; "array"; "[T; N]" ]
+ ~extract_type_name:(Some [ "core"; "array"; "Array" ])
+ [ "core"; "ops"; "index"; "IndexMut" ]
+ ();
(* core::slice::index::private_slice_index::Sealed<usize> *)
fmt
[ "core"; "slice"; "index"; "private_slice_index"; "usize" ]