Skip to content

Commit 2f71a06

Browse files
committed
Fix (or disable) warnings when building compiler
1 parent 26d9f04 commit 2f71a06

22 files changed

+152
-168
lines changed

jscomp/core/polyvar_pattern_match.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type output = (hash_names * lam) list
3333
module Coll = Hash.Make (struct
3434
type t = lam
3535

36-
let equal = Pervasives.( = )
36+
let equal = Stdlib.( = )
3737

3838
let hash = Hashtbl.hash
3939
end)

jscomp/ext/ext_int.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
type t = int
2626

27-
let compare (x : t) (y : t) = Pervasives.compare x y
27+
let compare (x : t) (y : t) = Stdlib.compare x y
2828

2929
let equal (x : t) (y : t) = x = y
3030

jscomp/ext/ext_js_file_kind.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
2424
type case = Upper | Little
2525

26-
type t = { case : case; suffix : Ext_js_suffix.t }
26+
type [@warning "-69"] t = { case : case; suffix : Ext_js_suffix.t }
2727

2828
let any_runtime_kind = { case = Little; suffix = Ext_js_suffix.Js }

jscomp/ext/misc.ml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ let string_of_file ic =
274274
in copy()
275275

276276
let output_to_bin_file_directly filename fn =
277-
let oc = Pervasives.open_out_bin filename in
277+
let oc = open_out_bin filename in
278278
match fn filename oc with
279279
| v -> close_out oc ; v
280280
| exception e -> close_out oc ; raise e
@@ -593,12 +593,12 @@ module Color = struct
593593
(* map a tag to a style, if the tag is known.
594594
@raise Not_found otherwise *)
595595
let style_of_tag s = match s with
596-
| "error" -> (!cur_styles).error
597-
| "warning" -> (!cur_styles).warning
598-
| "loc" -> (!cur_styles).loc
599-
| "info" -> [Bold; FG Yellow]
600-
| "dim" -> [Dim]
601-
| "filename" -> [FG Cyan]
596+
| Format.String_tag "error" -> (!cur_styles).error
597+
| Format.String_tag "warning" -> (!cur_styles).warning
598+
| Format.String_tag "loc" -> (!cur_styles).loc
599+
| Format.String_tag "info" -> [Bold; FG Yellow]
600+
| Format.String_tag "dim" -> [Dim]
601+
| Format.String_tag "filename" -> [FG Cyan]
602602
| _ -> raise Not_found
603603

604604
let color_enabled = ref true
@@ -619,13 +619,13 @@ module Color = struct
619619
(* add color handling to formatter [ppf] *)
620620
let set_color_tag_handling ppf =
621621
let open Format in
622-
let functions = pp_get_formatter_tag_functions ppf () in
622+
let functions = pp_get_formatter_stag_functions ppf () in
623623
let functions' = {functions with
624-
mark_open_tag=(mark_open_tag ~or_else:functions.mark_open_tag);
625-
mark_close_tag=(mark_close_tag ~or_else:functions.mark_close_tag);
624+
mark_open_stag=(mark_open_tag ~or_else:functions.mark_open_stag);
625+
mark_close_stag=(mark_close_tag ~or_else:functions.mark_close_stag);
626626
} in
627627
pp_set_mark_tags ppf true; (* enable tags *)
628-
pp_set_formatter_tag_functions ppf functions';
628+
pp_set_formatter_stag_functions ppf functions';
629629
(* also setup margins *)
630630
pp_set_margin ppf (pp_get_margin std_formatter());
631631
()

jscomp/ext/set.cppo.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ let print_elt = Format.pp_print_string
3131
#elif defined TYPE_IDENT
3232
type elt = Ident.t
3333
let compare_elt (x : elt) (y : elt) =
34-
let a = Pervasives.compare (x.stamp : int) y.stamp in
34+
let a = Stdlib.compare (x.stamp : int) y.stamp in
3535
if a <> 0 then a
3636
else
37-
let b = Pervasives.compare (x.name : string) y.name in
37+
let b = Stdlib.compare (x.name : string) y.name in
3838
if b <> 0 then b
39-
else Pervasives.compare (x.flags : int) y.flags
39+
else Stdlib.compare (x.flags : int) y.flags
4040
let [@inline] eq_elt (x : elt) y = Ident.same x y
4141
let print_elt = Ident.print
4242
#elif defined TYPE_INT

jscomp/js_parser/flow_sedlexing.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ exception MalFormed
1919

2020
type apos = int
2121

22-
type lexbuf = {
22+
type [@warning "-69"] lexbuf = {
2323
mutable buf: int array;
2424
mutable len: int;
2525
mutable offset: apos;

jscomp/js_parser/parse_error.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ type t =
167167
| ThisParamBannedInArrowFunctions
168168
| ThisParamBannedInConstructor
169169

170-
let compare (x : t) (y : t) = Pervasives.compare x y
170+
let compare (x : t) (y : t) = Stdlib.compare x y
171171

172172
exception Error of (Loc.t * t) list
173173

jscomp/ml/env.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ let current_unit = ref ""
635635

636636
(* Persistent structure descriptions *)
637637

638-
type pers_struct =
638+
type [@warning "-69"] pers_struct =
639639
{ ps_name: string;
640640
ps_sig: signature Lazy.t;
641641
ps_comps: module_components;

jscomp/ml/matching.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ module StoreExp =
475475
(struct
476476
type t = lambda
477477
type key = lambda
478-
let compare_key = Pervasives.compare
478+
let compare_key = compare
479479
let make_key = Lambda.make_key
480480
end)
481481

jscomp/ml/parmatch.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,10 @@ let is_absent_pat p = match p.pat_desc with
263263
let const_compare x y =
264264
match x,y with
265265
| Const_float f1, Const_float f2 ->
266-
Pervasives.compare (float_of_string f1) (float_of_string f2)
266+
compare (float_of_string f1) (float_of_string f2)
267267
| Const_string (s1, _), Const_string (s2, _) ->
268268
String.compare s1 s2
269-
| _, _ -> Pervasives.compare x y
269+
| _, _ -> compare x y
270270

271271
let records_args l1 l2 =
272272
(* Invariant: fields are already sorted by Typecore.type_label_a_list *)

0 commit comments

Comments
 (0)