Skip to content

Turn the (most mature) layouts extension on by default #2241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ocaml/testsuite/tests/letrec-check/unboxed.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
(* TEST
flags = '-extension layouts'
* expect
*)
(* CR layouts: Using [-extension layouts] here is not backward-compatible.
(* CR layouts: Using layout annotations here is not backward-compatible.
We can delete this when internal ticket 1110 is resolved.
*)

Expand Down
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/parsing/pr6604.compilers.reference
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File "pr6604.ml", line 9, characters 0-2:
9 | #1
^^
Error: Syntax error: line number directive not expected.
Error: Syntax error: unboxed integer literal with type-specifying suffix expected.
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/parsing/pr6604_2.compilers.reference
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File "pr6604_2.ml", line 9, characters 1-3:
9 | #1 "pr6604.ml"
^^
Error: Syntax error: line number directive not expected.
Error: Syntax error: unboxed integer literal with type-specifying suffix expected.
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-bits32/alloc.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* flambda2
flags = "-extension layouts"
** native
*)

Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-bits32/basics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* expect
flags = "-extension layouts_beta"
* expect
flags = "-extension layouts"
*)

(* This file contains typing tests for the layout [bits32].
Expand Down
2 changes: 0 additions & 2 deletions ocaml/testsuite/tests/typing-layouts-bits32/c_api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
*)

(* This file tests using external C functions with int32#. *)
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-bits32/parsing.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(* TEST
flags = "-extension layouts"
* expect
*)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(* TEST
flags = "-extension layouts"
*)
(* TEST *)

module Int32_u = Stdlib__Int32_u

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
*)

(* This file contains various tests for [int32#]. It's not an expect test
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-bits64/alloc.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* flambda2
flags = "-extension layouts"
** native
*)

Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-bits64/basics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* expect
flags = "-extension layouts_beta"
* expect
flags = "-extension layouts"
*)

(* This file contains typing tests for the layout [bits64].
Expand Down
2 changes: 0 additions & 2 deletions ocaml/testsuite/tests/typing-layouts-bits64/c_api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
*)

(* This file tests using external C functions with int64#. *)
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-bits64/parsing.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(* TEST
flags = "-extension layouts"
* expect
*)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(* TEST
flags = "-extension layouts"
*)
(* TEST *)

module Int64_u = Stdlib__Int64_u
module Int32_u = Stdlib__Int32_u
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
*)

(* This file contains various tests for [int64#]. It's not an expect test
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-float64/alloc.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* flambda2
flags = "-extension layouts"
** native
*)

Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-float64/basics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
** expect
flags = "-extension layouts_beta"
** expect
flags = "-extension layouts"
*)

(* This file contains typing tests for the layout [float64].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(* TEST
* bytecode
flags = "-g -extension layouts"
flags = "-g"
*)

let f1 f i = Stdlib__Float_u.to_float (f i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
** setup-ocamlc.byte-build-env
ocamlc_byte_exit_status = "2"
*** ocamlc.byte
flags = "-disable-all-extensions"
compiler_reference = "${test_source_directory}/unboxed_floats_disabled.compilers.reference"
**** check-ocamlc.byte-output


*)

(* mshinwell: This test is now only run with flambda2, as the corresponding
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File "unboxed_floats.ml", line 59, characters 11-16:
59 | let pi = #3.14 in
File "unboxed_floats.ml", line 56, characters 11-16:
56 | let pi = #3.14 in
^^^^^
Error: This construct requires the stable version of the extension "layouts", which is disabled and cannot be used
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-word/alloc.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* flambda2
flags = "-extension layouts"
** native
*)

Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-word/basics.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* expect
flags = "-extension layouts_beta"
* expect
flags = "-extension layouts"
*)

(* This file contains typing tests for the layout [word].
Expand Down
2 changes: 0 additions & 2 deletions ocaml/testsuite/tests/typing-layouts-word/c_api.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
*)

(* This file tests using external C functions with nativeint#. *)
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts-word/parsing.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(* TEST
flags = "-extension layouts"
* expect
*)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(* TEST
flags = "-extension layouts"
*)
(* TEST *)

module Nativeint_u = Stdlib__Nativeint_u
module Int32_u = Stdlib__Int32_u
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
*)

(* This file contains various tests for [nativeint#]. It's not an expect test
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts/annots.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* expect
flags = "-extension layouts"
* expect
flags = "-extension layouts_beta"
*)
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts/any_in_types.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(* TEST
flags = "-extension layouts"
* native
* bytecode
*)
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts/basics.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* expect
flags = "-extension layouts"
* expect
flags = "-extension layouts_beta"
*)
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts/datatypes.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* expect
flags = "-extension layouts"
* expect
flags = "-extension layouts_beta"
*)
Expand Down

This file was deleted.

22 changes: 0 additions & 22 deletions ocaml/testsuite/tests/typing-layouts/error_message_attr_w53.ml

This file was deleted.

3 changes: 1 addition & 2 deletions ocaml/testsuite/tests/typing-layouts/immediates.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
** bytecode
flags = "-extension layouts_beta"
** native
flags = "-extension layouts"
** bytecode
flags = "-extension layouts"
** setup-ocamlc.byte-build-env
ocamlc_byte_exit_status = "2"
*** ocamlc.byte
flags = "-disable-all-extensions"
compiler_reference = "${test_source_directory}/immediates_disabled.compilers.reference"
**** check-ocamlc.byte-output

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File "immediates.ml", line 30, characters 0-30:
30 | type a : immediate = A | B | C
File "immediates.ml", line 29, characters 0-30:
29 | type a : immediate = A | B | C
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: The extension "layouts" is disabled and cannot be used
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts/modules.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* expect
flags = "-extension layouts"
* expect
flags = "-extension layouts_beta"
*)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* toplevel
flags = "-extension layouts"
compiler_reference = "${test_source_directory}/parsing_stable.compilers.reference"
* toplevel
flags = "-extension layouts_beta"
Expand Down
1 change: 0 additions & 1 deletion ocaml/testsuite/tests/typing-layouts/void.ml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
(* TEST
* expect
flags = "-extension layouts"
* expect
flags = "-extension layouts_beta"
*)
Expand Down
4 changes: 2 additions & 2 deletions ocaml/testsuite/tests/typing-unboxed/test.ml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(* TEST
flags = "-extension layouts -strict-sequence"
flags = "-strict-sequence"
* expect
*)
(* CR layouts: Using [-extension layouts] here is not backward-compatible.
(* CR layouts: Using layout annotations here is not backward-compatible.
We can delete this when internal ticket 1110 is resolved.
*)

Expand Down
39 changes: 27 additions & 12 deletions ocaml/testsuite/tests/warnings/w53.compilers.reference
Original file line number Diff line number Diff line change
Expand Up @@ -958,32 +958,47 @@ File "w53.ml", line 438, characters 39-52:
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 442, characters 21-34:
442 | type 'a t1 = 'a [@@error_message ""] (* rejected *)
File "w53.ml", line 441, characters 43-56:
441 | (int as ('a:value)[@error_message ""][@error_message ""]) (* reject second *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 445, characters 21-34:
445 | type 'a t1 = 'a [@@error_message ""] (* rejected *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 443, characters 19-32:
443 | type s1 = Foo1 [@error_message ""] (* rejected *)
File "w53.ml", line 446, characters 19-32:
446 | type s1 = Foo1 [@error_message ""] (* rejected *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 444, characters 22-35:
444 | let x : int = 42 [@@error_message ""] (* rejected *)
File "w53.ml", line 447, characters 22-35:
447 | let x : int = 42 [@@error_message ""] (* rejected *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 446, characters 22-35:
446 | external y : (int [@error_message ""]) -> (int [@error_message ""]) = (* rejected *)
File "w53.ml", line 449, characters 22-35:
449 | external y : (int [@error_message ""]) -> (int [@error_message ""]) = (* rejected *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 446, characters 51-64:
446 | external y : (int [@error_message ""]) -> (int [@error_message ""]) = (* rejected *)
File "w53.ml", line 449, characters 51-64:
449 | external y : (int [@error_message ""]) -> (int [@error_message ""]) = (* rejected *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 448, characters 39-52:
448 | external z : int -> int = "x" "y" [@@error_message ""] (* rejected *)
File "w53.ml", line 451, characters 39-52:
451 | external z : int -> int = "x" "y" [@@error_message ""] (* rejected *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 453, characters 45-58:
453 | let f1 v: ((_ : value)[@error_message ""][@error_message ""]) = v (* reject second *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context

File "w53.ml", line 454, characters 46-59:
454 | let f2 v: (('a : value)[@error_message ""][@error_message ""]) = v (* reject second *)
^^^^^^^^^^^^^
Warning 53 [misplaced-attribute]: the "error_message" attribute cannot appear in this context
Loading