Skip to content

Commit 71b0a9e

Browse files
authoredMar 5, 2025··
Remove -infer-with-bounds flag, defaulting to true (#3657)
It now looks like performance of with-bounds is satisfactory to release enabled by default, so let's just remove this flag entirely to clean things up.
1 parent 358cd7c commit 71b0a9e

37 files changed

+58
-421
lines changed
 

‎driver/main_args.ml

-11
Original file line numberDiff line numberDiff line change
@@ -759,10 +759,6 @@ in
759759
\ allows a set of extensions, and every successive universe includes \n\
760760
\ the previous one."
761761

762-
let mk_infer_with_bounds f =
763-
"-infer-with-bounds", Arg.Unit f,
764-
"Infer with-bounds on kinds for type declarations. May impact performance."
765-
766762
let mk_dump_dir f =
767763
"-dump-dir", Arg.String f,
768764
"redirects any file(s) that would be outputted as a result of other flags\n\
@@ -957,7 +953,6 @@ module type Common_options = sig
957953
val _extension : string -> unit
958954
val _no_extension : string -> unit
959955
val _extension_universe : string -> unit
960-
val _infer_with_bounds : unit -> unit
961956
val _noassert : unit -> unit
962957
val _nolabels : unit -> unit
963958
val _nostdlib : unit -> unit
@@ -1245,7 +1240,6 @@ struct
12451240
mk_extension F._extension;
12461241
mk_no_extension F._no_extension;
12471242
mk_extension_universe F._extension_universe;
1248-
mk_infer_with_bounds F._infer_with_bounds;
12491243
mk_for_pack_byt F._for_pack;
12501244
mk_g_byt F._g;
12511245
mk_no_g F._no_g;
@@ -1377,7 +1371,6 @@ struct
13771371
mk_extension F._extension;
13781372
mk_no_extension F._no_extension;
13791373
mk_extension_universe F._extension_universe;
1380-
mk_infer_with_bounds F._infer_with_bounds;
13811374
mk_noassert F._noassert;
13821375
mk_noinit F._noinit;
13831376
mk_nolabels F._nolabels;
@@ -1472,7 +1465,6 @@ struct
14721465
mk_extension F._extension;
14731466
mk_no_extension F._no_extension;
14741467
mk_extension_universe F._extension_universe;
1475-
mk_infer_with_bounds F._infer_with_bounds;
14761468
mk_for_pack_opt F._for_pack;
14771469
mk_g_opt F._g;
14781470
mk_no_g F._no_g;
@@ -1664,7 +1656,6 @@ module Make_opttop_options (F : Opttop_options) = struct
16641656
mk_extension F._extension;
16651657
mk_no_extension F._no_extension;
16661658
mk_extension_universe F._extension_universe;
1667-
mk_infer_with_bounds F._infer_with_bounds;
16681659
mk_no_float_const_prop F._no_float_const_prop;
16691660
mk_noassert F._noassert;
16701661
mk_noinit F._noinit;
@@ -1772,7 +1763,6 @@ struct
17721763
mk_extension F._extension;
17731764
mk_no_extension F._no_extension;
17741765
mk_extension_universe F._extension_universe;
1775-
mk_infer_with_bounds F._infer_with_bounds;
17761766
mk_noassert F._noassert;
17771767
mk_nolabels F._nolabels;
17781768
mk_nostdlib F._nostdlib;
@@ -1884,7 +1874,6 @@ module Default = struct
18841874
let _no_extension s = Language_extension.(disable_of_string_exn s)
18851875
let _extension_universe s =
18861876
Language_extension.(set_universe_and_enable_all_of_string_exn s)
1887-
let _infer_with_bounds = set Clflags.infer_with_bounds
18881877
let _noassert = set noassert
18891878
let _nolabels = set classic
18901879
let _nostdlib = set no_std_include

‎driver/main_args.mli

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module type Common_options = sig
3434
val _extension : string -> unit
3535
val _no_extension : string -> unit
3636
val _extension_universe : string -> unit
37-
val _infer_with_bounds : unit -> unit
3837
val _noassert : unit -> unit
3938
val _nolabels : unit -> unit
4039
val _nostdlib : unit -> unit

‎stdlib/dune

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626
-bin-annot
2727
-nostdlib
2828
-safe-string
29-
-strict-formats
30-
-infer-with-bounds))
29+
-strict-formats))
3130
(ocamlopt_flags
3231
(:include %{project_root}/ocamlopt_flags.sexp))
3332
(preprocess

‎testsuite/tests/typing-immediate/immediate.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ end;;
160160
Line 2, characters 2-41:
161161
2 | type t = Foo of int | Bar [@@immediate]
162162
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
163-
Error: The kind of type "t" is value
163+
Error: The kind of type "t" is immutable_data
164164
because it's a boxed variant type.
165165
But the kind of type "t" must be a subkind of immediate
166166
because of the annotation on the declaration of the type t.
@@ -174,7 +174,7 @@ end;;
174174
Line 2, characters 2-38:
175175
2 | type t = { foo : int } [@@immediate]
176176
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
177-
Error: The kind of type "t" is value
177+
Error: The kind of type "t" is immutable_data
178178
because it's a boxed record type.
179179
But the kind of type "t" must be a subkind of immediate
180180
because of the annotation on the declaration of the type t.

‎testsuite/tests/typing-jkind-bounds/annots.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
(* TEST
22
include stdlib_upstream_compatible;
3-
flags = "-infer-with-bounds";
43
{
54
expect;
65
}{
7-
flags += " -extension layouts_beta";
6+
flags = " -extension layouts_beta";
87
expect;
98
}
109
*)

‎testsuite/tests/typing-jkind-bounds/basics.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* TEST
2-
flags = "-infer-with-bounds -extension small_numbers";
2+
flags = "-extension small_numbers";
33
expect;
44
*)
55

‎testsuite/tests/typing-jkind-bounds/composite.ml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
(* TEST
2-
flags = "-infer-with-bounds";
32
expect;
43
*)
54

‎testsuite/tests/typing-jkind-bounds/gadt.ml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
(* TEST
2-
flags = "-infer-with-bounds";
32
expect;
43
*)
54

‎testsuite/tests/typing-jkind-bounds/modalities.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(* TEST
2-
flags = "-extension layouts_alpha -infer-with-bounds";
2+
flags = "-extension layouts_alpha";
33
expect;
44
*)
55
let use_uncontended : 'a @ uncontended -> unit = fun _ -> ()

‎testsuite/tests/typing-jkind-bounds/no-infer-across-modules/define_with_kinds.ml

-27
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.