Skip to content

Commit

Permalink
removed Hashtbl from lib.ml + ocaml_index.ml adapted to requires_hidd…
Browse files Browse the repository at this point in the history
…en (to be re-checked)

Signed-off-by: HasanA <[email protected]>
  • Loading branch information
MA0010 committed Jun 18, 2024
1 parent 1bf8bf8 commit 1893536
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
9 changes: 4 additions & 5 deletions src/dune_rules/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -350,10 +350,6 @@ module T = struct
Dyn.record
[ "name", Lib_name.to_dyn t.name; "loc", Loc.to_dyn_hum (Lib_info.loc t.info) ]
;;

(* We can't write a structural equality because of all the lazy fields *)
let equal : t -> t -> bool = phys_equal
let hash = Poly.hash
end

include T
Expand Down Expand Up @@ -473,8 +469,11 @@ let wrapped t =
| Some (This x) -> Some x)
;;

(* We can't write a structural equality because of all the lazy fields *)
let equal : t -> t -> bool = phys_equal
let hash = Poly.hash

include Comparable.Make (T)
module Tbl = Hashtbl.Make (T)

module L = struct
let top_closure l ~key ~deps =
Expand Down
2 changes: 0 additions & 2 deletions src/dune_rules/lib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -235,5 +235,3 @@ module Local : sig

include Comparable_intf.S with type key := t
end

module Tbl : Hashtbl.S with type key := t
6 changes: 2 additions & 4 deletions src/dune_rules/merlin/ocaml_index.ml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,9 @@ let cctx_rules cctx =
The implicit transitive libs correspond to the set:
(requires_link \ req_compile) *)
let* req_link = Compilation_context.requires_link cctx in
let+ req_compile = Compilation_context.requires_compile cctx in
List.filter req_link ~f:(fun l -> not (List.exists req_compile ~f:(Lib.equal l)))
Compilation_context.requires_hidden cctx
in
Lib_flags.L.include_flags non_compile_libs (Lib_mode.Ocaml Byte)
Lib_flags.L.include_flags [] non_compile_libs (Lib_mode.Ocaml Byte)
in
(* Indexing depends (recursively) on [required_compile] libs:
- These libs's cmt files should be built before indexing starts
Expand Down

0 comments on commit 1893536

Please sign in to comment.