[infer] Remove ppx_compare workaround for nonrec types (2)

Summary:
The past issue with ppx_compare on nonrec types has (at some point) been fixed.

Greped for `let compare = compare` and removed the workaround for `nonrec`.

Reviewed By: jberdine

Differential Revision: D21973087

fbshipit-source-id: 5e2043e20
master
Ezgi Çiçek 5 years ago committed by Facebook GitHub Bot
parent a383f2afd2
commit c23e0044fc

@ -53,21 +53,15 @@ let equal = [%compare.equal: t]
let hash = Hashtbl.hash let hash = Hashtbl.hash
module Set = Caml.Set.Make (struct module Set = Caml.Set.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
module Map = Caml.Map.Make (struct module Map = Caml.Map.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
module Hash = Hashtbl.Make (struct module Hash = Hashtbl.Make (struct
type nonrec t = t type nonrec t = t [@@deriving equal]
let equal = equal
let hash = hash let hash = hash
end) end)

@ -19,9 +19,7 @@ let get_field_name {field_name} = field_name
let is_java {class_name} = Typ.Name.Java.is_class class_name let is_java {class_name} = Typ.Name.Java.is_class class_name
module T = struct module T = struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end end
module Set = Caml.Set.Make (T) module Set = Caml.Set.Make (T)

@ -74,21 +74,15 @@ let equal i1 i2 =
(** {2 Set for identifiers} *) (** {2 Set for identifiers} *)
module Set = Caml.Set.Make (struct module Set = Caml.Set.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
module Map = Caml.Map.Make (struct module Map = Caml.Map.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
module Hash = Hashtbl.Make (struct module Hash = Hashtbl.Make (struct
type nonrec t = t type nonrec t = t [@@deriving equal]
let equal = equal
let hash (id : t) = Hashtbl.hash id let hash (id : t) = Hashtbl.hash id
end) end)
@ -240,9 +234,7 @@ let to_string id = F.asprintf "%a" pp id
let pp_name f name = F.pp_print_string f (name_to_string name) let pp_name f name = F.pp_print_string f (name_to_string name)
module HashQueue = Hash_queue.Make (struct module HashQueue = Hash_queue.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let hash = Hashtbl.hash let hash = Hashtbl.hash

@ -13,15 +13,11 @@ module L = Logging
type t = {classname: string; package: string option} [@@deriving compare, equal] type t = {classname: string; package: string option} [@@deriving compare, equal]
module Map = Caml.Map.Make (struct module Map = Caml.Map.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
module Set = Caml.Set.Make (struct module Set = Caml.Set.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
let make ~package ~classname = let make ~package ~classname =

@ -49,13 +49,9 @@ let rename ~f {plain; mangled} =
module Set = Caml.Set.Make (struct module Set = Caml.Set.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
module Map = Caml.Map.Make (struct module Map = Caml.Map.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)

@ -176,9 +176,7 @@ module Node = struct
end) end)
module IdMap = PrettyPrintable.MakePPMap (struct module IdMap = PrettyPrintable.MakePPMap (struct
type t = id type t = id [@@deriving compare]
let compare = compare_id
let pp = pp_id let pp = pp_id
end) end)

@ -735,11 +735,7 @@ let make_java ~class_name ~return_type ~method_name ~parameters ~kind () =
let make_objc_dealloc name = ObjC_Cpp (ObjC_Cpp.make_dealloc name) let make_objc_dealloc name = ObjC_Cpp (ObjC_Cpp.make_dealloc name)
module Hashable = struct module Hashable = struct
type nonrec t = t type nonrec t = t [@@deriving compare, equal]
let equal = equal
let compare = compare
let hash = hash let hash = hash
@ -751,17 +747,13 @@ module LRUHash = LRUHashtbl.Make (Hashable)
module HashQueue = Hash_queue.Make (Hashable) module HashQueue = Hash_queue.Make (Hashable)
module Map = PrettyPrintable.MakePPMap (struct module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)
@ -801,9 +793,7 @@ let to_filename pname =
module SQLite = struct module SQLite = struct
module T = struct module T = struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let hash = hash let hash = hash

@ -320,9 +320,7 @@ let is_objc_static_local_of_proc_name pname pvar =
let is_block_pvar pvar = Typ.has_block_prefix (Mangled.to_string (get_name pvar)) let is_block_pvar pvar = Typ.has_block_prefix (Mangled.to_string (get_name pvar))
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp Pp.text let pp = pp Pp.text
end) end)

@ -509,17 +509,13 @@ module Name = struct
end end
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)
module Map = PrettyPrintable.MakePPMap (struct module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -88,9 +88,7 @@ let get_footprint_index t =
module Map = PrettyPrintable.MakePPMap (struct module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -188,9 +188,7 @@ end
include Raw include Raw
module BaseMap = PrettyPrintable.MakePPMap (struct module BaseMap = PrettyPrintable.MakePPMap (struct
type t = base type t = base [@@deriving compare]
let compare = compare_base
let pp = pp_base let pp = pp_base
end) end)

@ -23,9 +23,7 @@ let dummy = make Procname.empty_block Location.dummy
let pp fmt t = F.fprintf fmt "%a at %a" Procname.pp t.pname Location.pp t.loc let pp fmt t = F.fprintf fmt "%a at %a" Procname.pp t.pname Location.pp t.loc
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -94,9 +94,7 @@ let compare_err_data err_data1 err_data2 = Location.compare err_data1.loc err_da
module ErrDataSet = (* set err_data with no repeated loc *) module ErrDataSet = (* set err_data with no repeated loc *)
Caml.Set.Make (struct Caml.Set.Make (struct
type t = err_data type t = err_data [@@deriving compare]
let compare = compare_err_data
end) end)
(** Hash table to implement error logs *) (** Hash table to implement error logs *)

@ -18,9 +18,7 @@ let site t = t.site
let pp fmt s = CallSite.pp fmt s.site let pp fmt s = CallSite.pp fmt s.site
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -60,9 +60,7 @@ module DefaultNode : Node with type t = Procdesc.Node.t and type id = Procdesc.N
let pp_id = Procdesc.Node.pp_id let pp_id = Procdesc.Node.pp_id
module OrderedId = struct module OrderedId = struct
type t = id type t = id [@@deriving compare]
let compare = compare_id
let pp = pp_id let pp = pp_id
end end
@ -98,9 +96,7 @@ end = struct
let pp_id fmt (id, index) = F.fprintf fmt "(%a: %d)" Procdesc.Node.pp_id id index let pp_id fmt (id, index) = F.fprintf fmt "(%a: %d)" Procdesc.Node.pp_id id index
module OrderedId = struct module OrderedId = struct
type t = id type t = id [@@deriving compare]
let compare = compare_id
let pp = pp_id let pp = pp_id
end end

@ -49,9 +49,7 @@ module Make (Kind : Kind) = struct
let pp fmt s = F.fprintf fmt "%a(%a)" Kind.pp s.kind CallSite.pp s.site let pp fmt s = F.fprintf fmt "%a(%a)" Kind.pp s.kind CallSite.pp s.site
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -65,9 +65,7 @@ module Make (Kind : Kind) = struct
let with_callsite t callee_site = {t with site= callee_site} let with_callsite t callee_site = {t with site= callee_site}
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)
@ -93,9 +91,7 @@ module Dummy = struct
module Kind = struct module Kind = struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let matches ~caller ~callee = Int.equal 0 (compare caller callee) let matches ~caller ~callee = Int.equal 0 (compare caller callee)
@ -103,9 +99,7 @@ module Dummy = struct
end end
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -48,9 +48,7 @@ let pp_range f (loc_start, loc_end) =
module Map = PrettyPrintable.MakePPMap (struct module Map = PrettyPrintable.MakePPMap (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -24,9 +24,7 @@ type t =
let equal = [%compare.equal: t] let equal = [%compare.equal: t]
module OrderedSourceFile = struct module OrderedSourceFile = struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end end
module Map = Caml.Map.Make (OrderedSourceFile) module Map = Caml.Map.Make (OrderedSourceFile)

@ -391,9 +391,7 @@ end = struct
module PathMap = Caml.Map.Make (struct module PathMap = Caml.Map.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
let pp fmt path = let pp fmt path =

@ -50,9 +50,7 @@ let compare (rc1 : t) (rc2 : t) =
module Set = Caml.Set.Make (struct module Set = Caml.Set.Make (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
end) end)
let is_inst_rearrange node = let is_inst_rearrange node =

@ -26,9 +26,7 @@ let pp f l = F.fprintf f "v%d" l
let of_id v = v let of_id v = v
module PPKey = struct module PPKey = struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end end

@ -245,10 +245,7 @@ module JNI = struct
| FullyQualifiedClass of (string * string) | FullyQualifiedClass of (string * string)
| Array of t | Array of t
| Method of (t list * t) | Method of (t list * t)
[@@deriving compare, equal]
let compare = compare
let equal = equal
let parse_str = parse_str let parse_str = parse_str

@ -27,9 +27,7 @@ module MockTraceElem = struct
module Kind = struct module Kind = struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let matches = matches let matches = matches
@ -37,9 +35,7 @@ module MockTraceElem = struct
end end
module Set = PrettyPrintable.MakePPSet (struct module Set = PrettyPrintable.MakePPSet (struct
type nonrec t = t type nonrec t = t [@@deriving compare]
let compare = compare
let pp = pp let pp = pp
end) end)

@ -31,9 +31,7 @@ module MockNode = struct
let pp_id fmt i = F.pp_print_int fmt i let pp_id fmt i = F.pp_print_int fmt i
module OrderedId = struct module OrderedId = struct
type t = id type t = id [@@deriving compare]
let compare = compare_id
let pp = pp_id let pp = pp_id
end end

Loading…
Cancel
Save