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

+1-1
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

+1-1
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

+1-1
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

+11-11
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

+3-3
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

+1-1
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

+1-1
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

+1-1
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

+1-1
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

+2-2
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 *)

jscomp/ml/parmatch.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ val le_pat : pattern -> pattern -> bool
3737
val le_pats : pattern list -> pattern list -> bool
3838

3939
(* Exported compatibility functor, abstracted over constructor equality *)
40-
module Compat :
40+
module [@warning "-67"] Compat :
4141
functor
4242
(Constr: sig
4343
val equal :

jscomp/ml/parser.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ type let_binding =
372372
lb_text: text Lazy.t;
373373
lb_loc: Location.t; }
374374

375-
type let_bindings =
375+
type [@warning "-69"] let_bindings =
376376
{ lbs_bindings: let_binding list;
377377
lbs_rec: rec_flag;
378378
lbs_extension: string Asttypes.loc option;

jscomp/ml/parser.mly

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ type let_binding =
266266
lb_text: text Lazy.t;
267267
lb_loc: Location.t; }
268268

269-
type let_bindings =
269+
type [@warning "-69"] let_bindings =
270270
{ lbs_bindings: let_binding list;
271271
lbs_rec: rec_flag;
272272
lbs_extension: string Asttypes.loc option;

jscomp/ml/printtyp.ml

+7-6
Original file line numberDiff line numberDiff line change
@@ -1579,20 +1579,21 @@ let report_unification_error ppf env ?(unif=true)
15791579

15801580

15811581
let super_type_expansion ~tag t ppf t' =
1582+
let tag = Format.String_tag tag in
15821583
if same_path t t' then begin
1583-
Format.pp_open_tag ppf tag;
1584+
Format.pp_open_stag ppf tag;
15841585
type_expr ppf t;
1585-
Format.pp_close_tag ppf ();
1586+
Format.pp_close_stag ppf ();
15861587
end else begin
15871588
let t' = if proxy t == proxy t' then unalias t' else t' in
15881589
fprintf ppf "@[<2>";
1589-
Format.pp_open_tag ppf tag;
1590+
Format.pp_open_stag ppf tag;
15901591
fprintf ppf "%a" type_expr t;
1591-
Format.pp_close_tag ppf ();
1592+
Format.pp_close_stag ppf ();
15921593
fprintf ppf "@ @{<dim>(defined as@}@ ";
1593-
Format.pp_open_tag ppf tag;
1594+
Format.pp_open_stag ppf tag;
15941595
fprintf ppf "%a" type_expr t';
1595-
Format.pp_close_tag ppf ();
1596+
Format.pp_close_stag ppf ();
15961597
fprintf ppf "@{<dim>)@}";
15971598
fprintf ppf "@]";
15981599
end

jscomp/ml/typecore.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ let enter_variable ?(is_module=false) ?(is_as_variable=false) loc name ty =
436436
let sort_pattern_variables vs =
437437
List.sort
438438
(fun (x,_,_,_,_) (y,_,_,_,_) ->
439-
Pervasives.compare (Ident.name x) (Ident.name y))
439+
compare (Ident.name x) (Ident.name y))
440440
vs
441441

442442
let enter_orpat_variables loc env p1_vs p2_vs =

jscomp/ml/typedtreeIter.mli

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ module type IteratorArgument = sig
7373

7474
end
7575

76-
module MakeIterator :
76+
module [@warning "-67"] MakeIterator :
7777
functor (Iter : IteratorArgument) ->
7878
sig
7979
val iter_structure : structure -> unit

jscomp/super_errors/super_typecore.ml

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ let super_report_unification_error = Printtyp.super_report_unification_error
1313
let reset_and_mark_loops = Printtyp.reset_and_mark_loops
1414
let type_expr = Printtyp.type_expr
1515

16-
let tagged tag fn ppf arg =
17-
Format.pp_open_tag ppf tag;
18-
fn ppf arg;
19-
Format.pp_close_tag ppf ()
20-
2116
let rec bottom_aliases = function
2217
| (_, one) :: (_, two) :: rest -> begin match bottom_aliases rest with
2318
| Some types -> Some types

lib/4.06.1/rescript.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7413,7 +7413,7 @@ module Ext_js_file_kind
74137413
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
74147414
type case = Upper | Little
74157415

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

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

lib/4.06.1/unstable/all_ounit_tests.ml

+14-14
Original file line numberDiff line numberDiff line change
@@ -3042,7 +3042,7 @@ end = struct
30423042

30433043
type t = int
30443044

3045-
let compare (x : t) (y : t) = Pervasives.compare x y
3045+
let compare (x : t) (y : t) = Stdlib.compare x y
30463046

30473047
let equal (x : t) (y : t) = x = y
30483048

@@ -8639,7 +8639,7 @@ let string_of_file ic =
86398639
in copy()
86408640

86418641
let output_to_bin_file_directly filename fn =
8642-
let oc = Pervasives.open_out_bin filename in
8642+
let oc = open_out_bin filename in
86438643
match fn filename oc with
86448644
| v -> close_out oc ; v
86458645
| exception e -> close_out oc ; raise e
@@ -8958,12 +8958,12 @@ module Color = struct
89588958
(* map a tag to a style, if the tag is known.
89598959
@raise Not_found otherwise *)
89608960
let style_of_tag s = match s with
8961-
| "error" -> (!cur_styles).error
8962-
| "warning" -> (!cur_styles).warning
8963-
| "loc" -> (!cur_styles).loc
8964-
| "info" -> [Bold; FG Yellow]
8965-
| "dim" -> [Dim]
8966-
| "filename" -> [FG Cyan]
8961+
| Format.String_tag "error" -> (!cur_styles).error
8962+
| Format.String_tag "warning" -> (!cur_styles).warning
8963+
| Format.String_tag "loc" -> (!cur_styles).loc
8964+
| Format.String_tag "info" -> [Bold; FG Yellow]
8965+
| Format.String_tag "dim" -> [Dim]
8966+
| Format.String_tag "filename" -> [FG Cyan]
89678967
| _ -> raise Not_found
89688968

89698969
let color_enabled = ref true
@@ -8984,13 +8984,13 @@ module Color = struct
89848984
(* add color handling to formatter [ppf] *)
89858985
let set_color_tag_handling ppf =
89868986
let open Format in
8987-
let functions = pp_get_formatter_tag_functions ppf () in
8987+
let functions = pp_get_formatter_stag_functions ppf () in
89888988
let functions' = {functions with
8989-
mark_open_tag=(mark_open_tag ~or_else:functions.mark_open_tag);
8990-
mark_close_tag=(mark_close_tag ~or_else:functions.mark_close_tag);
8989+
mark_open_stag=(mark_open_tag ~or_else:functions.mark_open_stag);
8990+
mark_close_stag=(mark_close_tag ~or_else:functions.mark_close_stag);
89918991
} in
89928992
pp_set_mark_tags ppf true; (* enable tags *)
8993-
pp_set_formatter_tag_functions ppf functions';
8993+
pp_set_formatter_stag_functions ppf functions';
89948994
(* also setup margins *)
89958995
pp_set_margin ppf (pp_get_margin std_formatter());
89968996
()
@@ -15011,7 +15011,7 @@ type let_binding =
1501115011
lb_text: text Lazy.t;
1501215012
lb_loc: Location.t; }
1501315013

15014-
type let_bindings =
15014+
type [@warning "-69"] let_bindings =
1501515015
{ lbs_bindings: let_binding list;
1501615016
lbs_rec: rec_flag;
1501715017
lbs_extension: string Asttypes.loc option;
@@ -38389,7 +38389,7 @@ module Ext_js_file_kind
3838938389
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *)
3839038390
type case = Upper | Little
3839138391

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

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

0 commit comments

Comments
 (0)