Commit Graph

3215 Commits (001c2d12836f9c5d3b688af1f83412d39a9be195)

Author SHA1 Message Date
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
David Allsopp 37d6394874 Update Changes for #9925 2020-09-21 13:35:14 +01:00
David Allsopp 14300d3b1a Fix -fdebug-prefix-map when using flexlink
Prepend the -fdebug-prefix-map= option with -link if the "linker" is in
fact flexlink.
2020-09-21 10:11:39 +01:00
Gabriel Scherer 9f3472dc4a
Merge pull request #9669 from lpw25/fix-7538
Check for misplaced attributes on module aliases (Fix #7538)
2020-09-18 14:57:42 +02:00
Matthew Ryan b6b42f3ce6
Re-check Tpackage scope escapes after normalising paths (#9715)
Rewrite check_scope_escape using proper marking and unmarking

This uses the Btype.snapshot/backtrack mechanism, to ensure that we
always undo marking on types from the environment and to avoid a
`try ... with ...` construction for each recursive call.
2020-09-18 14:38:32 +02:00
Leo White 3c9ca39e14 Add Changes entry 2020-09-18 09:45:23 +01:00
Leo White bbad93d222
Merge pull request #9783 from lpw25/widen-warning-16
Widen warning 16 to more cases
2020-09-18 09:12:56 +01:00
Leo White 2cb6066e4b Add Changes entry 2020-09-17 18:54:23 +01:00
Sadiq Jaffer c10217818f
Garbage collector colours change (#9756) 2020-09-17 17:24:04 +02:00
Florian Angeletti d0e983e2aa
Merge pull request #9745 from johnwhitington/trunk
Unify labeled and unlabeled Standard Library module interfaces
2020-09-15 11:07:25 +02:00
Xavier Leroy ba0a9c2ce8
Export, document, and use Unix._exit (#9914)
This is a wrapper around the _exit system call.  It has been implemented
in otherlibs/unix/exit.c for a long time but never exported.

This commit exports and documents it as `Unix._exit`.

The Unix implementation of `establish_server` is changed to use `_exit`
and to have gender-neutral comments.

A test was added to check that OCaml finalization actions are not performed.
2020-09-14 19:03:42 +02:00
Florian Angeletti bc4d260de7
Merge pull request #9865 from raphael-proust/pp_print_seq
Stdlib.Format: add pp_print_seq
2020-09-14 16:52:11 +02:00
David Allsopp 3b1d4dafe0
Eliminate caml_code_area globals (#9909) 2020-09-14 09:16:09 +01:00
Raphaël Proust 63f107c62e Credit MR reviewer 2020-09-12 09:19:30 +02:00
Florian Angeletti 9a31c888b1
Merge pull request #9433 from lpw25/fix-package-constraints-for-module-aliases
Fix package constraints for module aliases
2020-09-11 18:21:24 +02:00
John Whitington c3f6cd7ff7 Merge remote-tracking branch 'upstream/trunk' into trunk 2020-09-11 14:14:38 +01:00
John Whitington 5a230ee8e7 Add reviewer 2020-09-10 19:33:19 +01:00
Chet Murthy 0d46b5206d redo: This little patch fixes the pretty-printing of "rebind" extension-constructors (and also rebind exceptions) so that it matches the parser. With tests. a rebind extension like
type t  += A = M.A [@a]
was pretty-printed as

type t += A[@a] = M.A
[obviously wrong, also not accepted by parser]

With tests for extension-constructors and exceptions.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-extension-constructor-rebind-pprint-4.11
# Changes to be committed:
#	modified:   Changes
#	modified:   parsing/pprintast.ml
#	modified:   testsuite/tests/parsetree/source.ml
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-10 11:09:06 -07:00
Chet Murthy 5b8b6de2ac sorry, too-long line in Changes file
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-polyvariant-pprint
# Your branch is up to date with 'my-fork/pr-polyvariant-pprint'.
#
# Changes to be committed:
#	modified:   Changes
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-09 15:15:22 -07:00
Chet Murthy e2ec81fe56 re-do of print polyvariants that start with a core_type,closed, not low with leading bar ("|").
a type "[ | w ]" must be printed with the "|", or it won't be
reparseable.

with tests, Changes entry.

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch pr-polyvariant-pprint
# Changes to be committed:
#	modified:   Changes
#	modified:   parsing/parsetree.mli
#	modified:   parsing/pprintast.ml
#	modified:   testsuite/tests/parsetree/source.ml
#
# Untracked files:
#	Changes.orig
#	parsing/pprintast.ml.orig
#	testsuite/tests/parsetree/source.ml.orig
#	testsuite/tests/parsetree/source.ml.rej
#
2020-09-09 13:37:36 -07:00
Gabriel Scherer 03839754f4
List.equal, List.compare (#9668)
`List.equal f foo bar` is nicer than
`List.length foo = List.length bar && List.for_all2 f foo bar`.

Note: with List.compare there is a risk of users having opened the
List module, and then using 'compare' from the stdlib unqualified. For
example:

    List.(sort compare foo bar)

Such code will break (type error), and has to be fixed by using
Stdlib.compare. Stdlib is available since OCaml 4.07; people wishing
to support both 4.12 and older releases would have to avoid opening
List, or rebind 'compare' locally.
2020-09-09 20:01:04 +02:00
Gabriel Scherer 9c5a2ef8dc
Merge pull request #9440 from progman1/genprintvalbug
#9148 extension constructor printing discrepancy in REPL
2020-09-09 17:11:02 +02:00
Gabriel Scherer aa858a35ae
Merge pull request #9889 from Octachron/pprintyp_short_path_cache
printtyp: cache short path data in wrap_env
2020-09-09 10:50:01 +02:00
David Allsopp 2235354bd5
The opposite of O_TEXT is not O_BINARY (#9892)
Extra modes were added in the version 7 CRT (.NET 2002).  Update `descriptor_is_in_binary_mode`  so that the original mode is correctly restored at exit, even if it is neither `O_TEXT` nor `O_BINARY`.
2020-09-08 18:17:02 +02:00
progman1 8f87147c9d toplevel: a discrepancy in extension constructors printing
fixes #9148

genprintval.tree_of_extension was missing instantiation of constructor argument types.
the Ctype.apply code is factorized out from a number of other places.
2020-09-08 18:04:09 +02:00
Florian Angeletti 9f804a25d2
Merge pull request #9427 from Octachron/ocamldoc_list_syntax
ocamldoc: fix the printing of (::)
2020-09-08 17:32:17 +02:00
Florian Angeletti 5d7663aaa5 review 2020-09-08 17:24:46 +02:00
Nicolás Ojeda Bär 6db41e4816
riscv: fix register usage (#9890) 2020-09-08 09:55:19 +02:00
Xavier Leroy 1b48b5aa3c
Merge pull request #9872 from xavierleroy/seek-text-channels
Revised {in,out}_channel_length and seek_in for channels in text mode
2020-09-08 09:52:22 +02:00
Xavier Leroy 83c762974b Document the issue with pos_{in,out} and files opened in text mode
Add changes for 9872
2020-09-08 09:51:35 +02:00
octachron 1393a37509 ocamldoc: fix printing of (::) 2020-09-07 11:07:10 +02:00
Jeremy Yallop 44c053008a
Merge pull request #9066 from gasche/either
Add `('a, 'b)  Either.t = Left of 'a | Right of 'b` and `List.partition_map`
2020-09-03 22:47:55 +01:00
Florian Angeletti ce04a5c1b1 Merge pull request #9862 from Octachron/4.11.1_with_less_daring_assertions
9859: revert 9348, inferred function types and :>
(cherry picked from commit 28b82e2e397d129840e35fb8da0b8af8b9f59633)
2020-09-03 13:55:17 +02:00
Florian Angeletti 66c368ae77 Merge pull request #9857 from lpw25/fix-poly-refs-check
Add missing `lower_contravariant` call (fixes #9856)

(cherry picked from commit 56707233fb6e33d0e5d0719b8550a15db8aa02d9)
2020-09-03 13:55:17 +02:00
Florian Angeletti a2ecfc45a3 Reorder changes, "language feature" section 2020-09-03 13:55:17 +02:00
Gabriel Scherer ca6f3ee057 List.partition_map : (a -> (b, c) Either.t) -> a list -> b list * c list 2020-09-02 13:59:53 +02:00
Gabriel Scherer 25e59d63d8 Add `'a Either.t = Left of 'a | Right of 'b`
```ocaml
val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : left:('a1 -> 'a2) -> right:('b1 -> 'b2) -> ('a1, 'b1) t -> ('a2, 'b2) t
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
val equal :
  left:('a -> 'a -> bool) -> right:('b -> 'b -> bool) ->
  ('a, 'b) t -> ('a, 'b) t -> bool
val compare :
  left:('a -> 'a -> int) -> right:('b -> 'b -> int) ->
  ('a, 'b) t -> ('a, 'b) t -> int
```

Unlike [result], no [either] type is made available in Stdlib,
one needs to access [Either.t] explicitly:

- This type is less common in typical OCaml codebases,
  which prefer domain-specific variant types whose constructors
  carry more meaning.
- Adding this to Stdlib would raise warnings in existing codebases
  that already use a constructor named Left or Right:
  + when opening a module that exports such a name,
    warning 45 is raised
  + adding a second constructor of the same name in scope kicks
    in the disambiguation mechanisms, and warning 41 may now
    be raised by existing code.

If the use becomes more common in the future we can always
revisit this choice.
2020-09-02 13:59:53 +02:00
Yishuai Li 63c7071a34
Add Unix.SO_REUSEPORT (#9869)
Support the SO_REUSEPORT socket option.

Closes: #3512
2020-09-02 10:52:04 +02:00
Raphaël Proust bed23dfbbc Stdlib.Format: add pp_print_seq 2020-09-01 17:51:34 +02:00
Xavier Leroy 4c1654f135
z Systems: subtract immediate has its own range of valid immediate values (#9860)
Because it is turned into add immediate opposite in emit.mlp.
2020-08-26 09:23:44 +02:00
Stephen Dolan 41f0522df3
Use different symbol names for caml_do_local_roots on bytecode and native code (#9503) 2020-08-25 21:22:34 +01:00
Leo White ccf4df0758
Remove spurious Ptop_defs from #use (#9376)
* Remove spurious Ptop_defs from #use

* Add Changes entry
2020-08-25 18:01:03 +01:00
Stephen Dolan b735f187ac
Avoid Cconst_natint where Cconst_int will do (#9838)
Cconst_int generates better code, as it hits the instruction
selector's cases for small immediates.
2020-08-25 16:27:11 +01:00
Stephen Dolan 6e84a11181
Fix double free of toplevel bytecode (#9855) 2020-08-25 15:22:46 +01:00
David Allsopp 781b37b688
Actually remove directories (#9849)
`rm_rf` removed the files (recursively) but not the directories.
2020-08-20 16:06:46 +02:00
Xavier Leroy de791aa113 Changes entry for #9753 2020-08-20 11:53:44 +02:00
hhugo 49aa87c316
Introduce warning 68 to warn about hidden allocation due to pattern match of mutable field in curried functions (#9751)
Introduce new warning 68
2020-08-17 09:47:36 +01:00
Gabriel Scherer 68218d1906 Changes: reorder 4.11 Changes entries 2020-08-11 22:58:51 +02:00
Gabriel Scherer 07ddbe22eb Changes: #9790 is in 4.12, not 4.11 2020-08-11 22:33:11 +02:00
Gabriel Scherer f89356b89c Changes: #9795 is in 4.12, not 4.11 2020-08-11 22:33:11 +02:00