Skip to content

Commit f90acdc

Browse files
authored
Merge pull request #22199 from JuliaLang/tk/backports-0.6.0-rc3
[release-0.6] backports for 0.6.0-rc3
2 parents 68e911b + 73b5504 commit f90acdc

File tree

170 files changed

+2089
-1022
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+2089
-1022
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ script:
147147
rm -f julia/deps/scratch/libgit2-*/CMakeFiles/CMakeOutput.log
148148
# uncomment the following if failures are suspected to be due to the out-of-memory killer
149149
# - dmesg
150+
after_success:
151+
- cd julia && make -C doc deploy

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ endif
460460

461461
ifeq ($(OS), WINNT)
462462
[ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \
463-
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll libgfortran-3.dll libquadmath-0.dll libstdc++-6.dll libgcc_s_s*-1.dll libssp-0.dll libwinpthread-1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
463+
cp 7z.exe 7z.dll libexpat-1.dll zlib1.dll $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
464464
ifeq ($(USE_GPL_LIBS), 1)
465465
[ ! -d $(JULIAHOME)/dist-extras ] || ( cd $(JULIAHOME)/dist-extras && \
466466
cp busybox.exe $(BUILDROOT)/julia-$(JULIA_COMMIT)/bin )
@@ -590,17 +590,17 @@ ifneq (,$(filter $(ARCH), i386 i486 i586 i686))
590590
cd $(JULIAHOME)/dist-extras && \
591591
$(JLDOWNLOAD) http://downloads.sourceforge.net/sevenzip/7z920.exe && \
592592
7z x -y 7z920.exe 7z.exe 7z.dll && \
593-
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_42.2 \
594-
"mingw32-libgfortran3 mingw32-libquadmath0 mingw32-libstdc++6 mingw32-libgcc_s_sjlj1 mingw32-libssp0 mingw32-libwinpthread1 mingw32-libexpat1 mingw32-zlib1" && \
593+
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_Leap_42.2 \
594+
"mingw32-libexpat1 mingw32-zlib1" && \
595595
cp usr/i686-w64-mingw32/sys-root/mingw/bin/*.dll .
596596
else ifeq ($(ARCH),x86_64)
597597
cd $(JULIAHOME)/dist-extras && \
598598
$(JLDOWNLOAD) 7z920-x64.msi http://downloads.sourceforge.net/sevenzip/7z920-x64.msi && \
599599
7z x -y 7z920-x64.msi _7z.exe _7z.dll && \
600600
mv _7z.dll 7z.dll && \
601601
mv _7z.exe 7z.exe && \
602-
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_42.2 \
603-
"mingw64-libgfortran3 mingw64-libquadmath0 mingw64-libstdc++6 mingw64-libgcc_s_seh1 mingw64-libssp0 mingw64-libwinpthread1 mingw64-libexpat1 mingw64-zlib1" && \
602+
../contrib/windows/winrpm.sh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_Leap_42.2 \
603+
"mingw64-libexpat1 mingw64-zlib1" && \
604604
cp usr/x86_64-w64-mingw32/sys-root/mingw/bin/*.dll .
605605
else
606606
$(error no win-extras target for ARCH=$(ARCH))

NEWS.md

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -396,17 +396,22 @@ Library improvements
396396
`map(uppercase ∘ hex, 250:255)` is now equivalent to
397397
`map(x -> uppercase(hex(x)), 250:255)` ([#17155]).
398398
399+
* `enumerate` now supports the two-argument form `enumerate(::IndexStyle, iterable)`.
400+
This form allows specification of the returned indices' style. For example,
401+
`enumerate(IndexLinear, iterable)` yields linear indices and
402+
`enumerate(IndexCartesian, iterable)` yields cartesian indices ([#16378]).
403+
399404
Compiler/Runtime improvements
400405
-----------------------------
401406
402407
* `ccall` is now implemented as a macro,
403-
removing the need for special code-generator support for Intrinsics.
408+
removing the need for special code-generator support for `Intrinsics` ([#18754]).
404409
405410
* `ccall` gained limited support for a `llvmcall` calling-convention.
406-
This can replace many uses of `llvmcall` with a simpler, shorter declaration.
411+
This can replace many uses of `llvmcall` with a simpler, shorter declaration ([#18754]).
407412
408-
* All Intrinsics are now Builtin functions instead and have proper error checking
409-
and fall-back static compilation support.
413+
* All `Intrinsics` are now `Builtin` functions instead and have proper error checking
414+
and fall-back static compilation support ([#18754]).
410415
411416
Deprecated or removed
412417
---------------------
@@ -436,7 +441,7 @@ Deprecated or removed
436441
for example `(+)(J::UniformScaling, x::Number)`, have been deprecated in favor of
437442
unambiguous, explicit equivalents, for example `J.λ + x` ([#17607]).
438443
439-
* `num` and `den` have been deprecated in favor of `numerator` and `denominator` respectively ([#19233]).
444+
* `num` and `den` have been deprecated in favor of `numerator` and `denominator` respectively ([#19233],[#19246]).
440445
441446
* `delete!(ENV::EnvHash, k::AbstractString, def)` has been deprecated in favor of
442447
`pop!(ENV, k, def)`. Be aware that `pop!` returns `k` or `def`, whereas `delete!`
@@ -457,12 +462,12 @@ Deprecated or removed
457462
including step specification, for example `Dates.Hour(1):Dates.Hour(1):Dates.Hour(2)`
458463
([#19920]).
459464
460-
* `cummin` and `cummax` have been deprecated in favor of `accumulate`.
465+
* `cummin` and `cummax` have been deprecated in favor of `accumulate` ([#18931]).
461466
462467
* The `Array` constructor syntax `Array(T, dims...)` has been deprecated
463468
in favor of the forms `Array{T,N}(dims...)` (where `N` is known, or
464469
particularly `Vector{T}(dims...)` for `N = 1` and `Matrix{T}(dims...)` for `N = 2`),
465-
and `Array{T}(dims...)` (where `N` is not known) ([#19989]).
470+
and `Array{T}(dims...)` (where `N` is not known). Likewise for `SharedArray`s ([#19989]).
466471
467472
* `sumabs` and `sumabs2` have been deprecated in favor of `sum(abs, x)` and `sum(abs2, x)`, respectively.
468473
`maxabs` and `minabs` have similarly been deprecated in favor of `maximum(abs, x)` and `minimum(abs, x)`.
@@ -493,21 +498,37 @@ Deprecated or removed
493498
For example, `isnumber("123")` should now be expressed `all(isnumber, "123")`
494499
([#20342]).
495500
501+
* A few names related to indexing traits have been changed: `LinearIndexing` and
502+
`linearindexing` have been deprecated in favor of `IndexStyle`. `LinearFast` has
503+
been deprecated in favor of `IndexLinear`, and `LinearSlow` has been deprecated in
504+
favor of `IndexCartesian` ([#16378]).
505+
496506
* The two-argument forms of `map` (`map!(f, A)`) and `asyncmap!` (`asyncmap!(f, A)`)
497507
have been deprecated in anticipation of future semantic changes ([#19721]).
498508
509+
* `unsafe_wrap(String, ...)` has been deprecated in favor of `unsafe_string` ([#19449]).
510+
499511
* `zeros` and `ones` methods accepting an element type as the first argument and an
500512
array as the second argument, for example `zeros(Float64, [1, 2, 3])`, have been
501513
deprecated in favor of equivalent methods with the second argument instead the
502514
size of the array, for example `zeros(Float64, size([1, 2, 3]))` ([#21183]).
503515
516+
* `Base.promote_eltype_op` has been deprecated ([#19669], [#19814], [#19937]).
517+
504518
* `isimag` has been deprecated ([#19949]).
505519
506520
* The tuple-of-types form of `invoke`, `invoke(f, (types...), ...)`, has been deprecated
507521
in favor of the tuple-type form `invoke(f, Tuple{types...}, ...)` ([#18444]).
508522
523+
* `Base._promote_array_type` has been deprecated ([#19766]).
524+
509525
* `broadcast_zpreserving` has been deprecated ([#19533], [#19720]).
510526
527+
* Methods allowing indexing of tuples by `AbstractArray`s with more than one dimension
528+
have been deprecated. (Indexing a tuple by such a higher-dimensional `AbstractArray`
529+
should yield a tuple with more than one dimension, but tuples are one-dimensional.)
530+
([#19737]).
531+
511532
* `@test_approx_eq a b` has been deprecated in favor of `@test a ≈ b` (or,
512533
equivalently, `@test ≈(a, b)` or `@test isapprox(a, b)`).
513534
`@test_approx_eq_eps` has been deprecated in favor of new `@test` syntax:
@@ -516,19 +537,40 @@ Deprecated or removed
516537
`@test a ≈ b atol=c` in place of `@test ≈(a, b, atol=c)` (and hence
517538
`@test_approx_eq_eps a b c`) ([#19901]).
518539
540+
* `takebuf_array` has been deprecated in favor of `take!`, and `takebuf_string(x)`
541+
has been deprecated in favor of `String(take!(x))` ([#19088]).
542+
519543
* `convert` methods from `Diagonal` and `Bidiagonal` to subtypes of
520544
`AbstractTriangular` have been deprecated ([#17723]).
521545
546+
* `Base.LinAlg.arithtype` has been deprecated. If you were using `arithtype` within a
547+
`promote_op` call, instead use `promote_op(Base.LinAlg.matprod, Ts...)`. Otherwise,
548+
consider defining equivalent functionality locally ([#18218]).
549+
522550
* Special characters (`#{}()[]<>|&*?~;`) should now be quoted in commands. For example,
523551
``` `export FOO=1\;` ``` should replace ``` `export FOO=1;` ``` and
524552
``` `cd $dir '&&' $thingie` ``` should replace ``` `cd $dir && $thingie` ``` ([#19786]).
525553
554+
* Zero-argument `Channel` constructors (`Channel()`, `Channel{T}()`) have been deprecated
555+
in favor of equivalents accepting an explicit `Channel` size
556+
(`Channel(2)`, `Channel{T}(2)`) ([#18832]).
557+
526558
* The zero-argument constructor `MersenneTwister()` has been
527559
deprecated in favor of the explicit `MersenneTwister(0)` ([#16984]).
528560
561+
* `Base.promote_type(op::Type, Ts::Type...)` has been removed as part of an overhaul
562+
of `broadcast`'s promotion mechanism. If you need the functionality of that
563+
`Base.promote_type` method, consider defining it locally via
564+
`Core.Inference.return_type(op, Tuple{Ts...})` ([#18642]).
565+
529566
* `bitbroadcast` has been deprecated in favor of `broadcast`, which now produces a
530567
`BitArray` instead of `Array{Bool}` for functions yielding a boolean result ([#19771]).
531568
569+
* To complete the deprecation of histogram-related functions, `midpoints` has been
570+
deprecated. Instead use the
571+
[StatsBase.jl package](https://github.com/JuliaStats/StatsBase.jl)'s
572+
`midpoints` function ([#20058]).
573+
532574
Command-line option changes
533575
---------------------------
534576
@@ -550,6 +592,7 @@ Command-line option changes
550592
[#12563]: https://github.com/JuliaLang/julia/issues/12563
551593
[#15850]: https://github.com/JuliaLang/julia/issues/15850
552594
[#16213]: https://github.com/JuliaLang/julia/issues/16213
595+
[#16378]: https://github.com/JuliaLang/julia/issues/16378
553596
[#16961]: https://github.com/JuliaLang/julia/issues/16961
554597
[#16984]: https://github.com/JuliaLang/julia/issues/16984
555598
[#16986]: https://github.com/JuliaLang/julia/issues/16986
@@ -568,6 +611,7 @@ Command-line option changes
568611
[#18012]: https://github.com/JuliaLang/julia/issues/18012
569612
[#18050]: https://github.com/JuliaLang/julia/issues/18050
570613
[#18159]: https://github.com/JuliaLang/julia/issues/18159
614+
[#18218]: https://github.com/JuliaLang/julia/issues/18218
571615
[#18251]: https://github.com/JuliaLang/julia/issues/18251
572616
[#18330]: https://github.com/JuliaLang/julia/issues/18330
573617
[#18339]: https://github.com/JuliaLang/julia/issues/18339
@@ -581,19 +625,24 @@ Command-line option changes
581625
[#18473]: https://github.com/JuliaLang/julia/issues/18473
582626
[#18558]: https://github.com/JuliaLang/julia/issues/18558
583627
[#18628]: https://github.com/JuliaLang/julia/issues/18628
628+
[#18642]: https://github.com/JuliaLang/julia/issues/18642
584629
[#18644]: https://github.com/JuliaLang/julia/issues/18644
585630
[#18660]: https://github.com/JuliaLang/julia/issues/18660
586631
[#18690]: https://github.com/JuliaLang/julia/issues/18690
632+
[#18754]: https://github.com/JuliaLang/julia/issues/18754
587633
[#18777]: https://github.com/JuliaLang/julia/issues/18777
634+
[#18832]: https://github.com/JuliaLang/julia/issues/18832
588635
[#18839]: https://github.com/JuliaLang/julia/issues/18839
589636
[#18891]: https://github.com/JuliaLang/julia/issues/18891
590637
[#18931]: https://github.com/JuliaLang/julia/issues/18931
591638
[#18965]: https://github.com/JuliaLang/julia/issues/18965
592639
[#18977]: https://github.com/JuliaLang/julia/issues/18977
593640
[#19018]: https://github.com/JuliaLang/julia/issues/19018
641+
[#19088]: https://github.com/JuliaLang/julia/issues/19088
594642
[#19157]: https://github.com/JuliaLang/julia/issues/19157
595643
[#19233]: https://github.com/JuliaLang/julia/issues/19233
596644
[#19239]: https://github.com/JuliaLang/julia/issues/19239
645+
[#19246]: https://github.com/JuliaLang/julia/issues/19246
597646
[#19259]: https://github.com/JuliaLang/julia/issues/19259
598647
[#19288]: https://github.com/JuliaLang/julia/issues/19288
599648
[#19305]: https://github.com/JuliaLang/julia/issues/19305
@@ -610,6 +659,7 @@ Command-line option changes
610659
[#19598]: https://github.com/JuliaLang/julia/issues/19598
611660
[#19635]: https://github.com/JuliaLang/julia/issues/19635
612661
[#19636]: https://github.com/JuliaLang/julia/issues/19636
662+
[#19669]: https://github.com/JuliaLang/julia/issues/19669
613663
[#19670]: https://github.com/JuliaLang/julia/issues/19670
614664
[#19677]: https://github.com/JuliaLang/julia/issues/19677
615665
[#19680]: https://github.com/JuliaLang/julia/issues/19680
@@ -621,7 +671,9 @@ Command-line option changes
621671
[#19721]: https://github.com/JuliaLang/julia/issues/19721
622672
[#19722]: https://github.com/JuliaLang/julia/issues/19722
623673
[#19724]: https://github.com/JuliaLang/julia/issues/19724
674+
[#19737]: https://github.com/JuliaLang/julia/issues/19737
624675
[#19741]: https://github.com/JuliaLang/julia/issues/19741
676+
[#19766]: https://github.com/JuliaLang/julia/issues/19766
625677
[#19771]: https://github.com/JuliaLang/julia/issues/19771
626678
[#19779]: https://github.com/JuliaLang/julia/issues/19779
627679
[#19784]: https://github.com/JuliaLang/julia/issues/19784
@@ -631,6 +683,7 @@ Command-line option changes
631683
[#19800]: https://github.com/JuliaLang/julia/issues/19800
632684
[#19802]: https://github.com/JuliaLang/julia/issues/19802
633685
[#19811]: https://github.com/JuliaLang/julia/issues/19811
686+
[#19814]: https://github.com/JuliaLang/julia/issues/19814
634687
[#19841]: https://github.com/JuliaLang/julia/issues/19841
635688
[#19900]: https://github.com/JuliaLang/julia/issues/19900
636689
[#19901]: https://github.com/JuliaLang/julia/issues/19901
@@ -641,12 +694,14 @@ Command-line option changes
641694
[#19926]: https://github.com/JuliaLang/julia/issues/19926
642695
[#19931]: https://github.com/JuliaLang/julia/issues/19931
643696
[#19934]: https://github.com/JuliaLang/julia/issues/19934
697+
[#19937]: https://github.com/JuliaLang/julia/issues/19937
644698
[#19944]: https://github.com/JuliaLang/julia/issues/19944
645699
[#19949]: https://github.com/JuliaLang/julia/issues/19949
646700
[#19950]: https://github.com/JuliaLang/julia/issues/19950
647701
[#19989]: https://github.com/JuliaLang/julia/issues/19989
648702
[#20009]: https://github.com/JuliaLang/julia/issues/20009
649703
[#20047]: https://github.com/JuliaLang/julia/issues/20047
704+
[#20058]: https://github.com/JuliaLang/julia/issues/20058
650705
[#20079]: https://github.com/JuliaLang/julia/issues/20079
651706
[#20164]: https://github.com/JuliaLang/julia/issues/20164
652707
[#20213]: https://github.com/JuliaLang/julia/issues/20213

base/Enums.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ julia> f(apple)
4545
"I'm a Fruit with value: 1"
4646
```
4747
48-
`BaseType`, which defaults to `Int32`, must be a primitive subtype of Integer. Member values can be converted between
49-
the enum type and `BaseType`. `read` and `write` perform these conversions automatically.
48+
`BaseType`, which defaults to [`Int32`](@ref), must be a primitive subtype of `Integer`.
49+
Member values can be converted between the enum type and `BaseType`. `read` and `write`
50+
perform these conversions automatically.
5051
"""
5152
macro enum(T,syms...)
5253
if isempty(syms)

base/REPL.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,7 @@ function respond(f, repl, main; pass_empty = false)
633633
line = String(take!(buf))
634634
if !isempty(line) || pass_empty
635635
reset(repl)
636+
local val, bt
636637
try
637638
# note: value wrapped carefully here to ensure it doesn't get passed through expand
638639
response = eval(Main, Expr(:body, Expr(:return, Expr(:call, QuoteNode(f), QuoteNode(line)))))

base/REPLCompletions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function get_type_call(expr::Expr)
282282
found ? push!(args, typ) : push!(args, Any)
283283
end
284284
# use _methods_by_ftype as the function is supplied as a type
285-
world = typemax(UInt)
285+
world = ccall(:jl_get_world_counter, UInt, ())
286286
mt = Base._methods_by_ftype(Tuple{ft, args...}, -1, world)
287287
length(mt) == 1 || return (Any, false)
288288
m = first(mt)

base/abstractarray.jl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
## Basic functions ##
44

5+
"""
6+
AbstractArray{T, N}
7+
8+
Abstract array supertype which arrays inherit from.
9+
"""
10+
AbstractArray
11+
512
"""
613
size(A::AbstractArray, [dim...])
714
@@ -482,7 +489,7 @@ default is an `Array{element_type}(dims...)`.
482489
For example, `similar(1:10, 1, 4)` returns an uninitialized `Array{Int,2}` since ranges are
483490
neither mutable nor support 2 dimensions:
484491
485-
```julia
492+
```julia-repl
486493
julia> similar(1:10, 1, 4)
487494
1×4 Array{Int64,2}:
488495
4419743872 4374413872 4419743888 0
@@ -491,17 +498,17 @@ julia> similar(1:10, 1, 4)
491498
Conversely, `similar(trues(10,10), 2)` returns an uninitialized `BitVector` with two
492499
elements since `BitArray`s are both mutable and can support 1-dimensional arrays:
493500
494-
```julia
501+
```julia-repl
495502
julia> similar(trues(10,10), 2)
496503
2-element BitArray{1}:
497504
false
498505
false
499506
```
500507
501-
Since `BitArray`s can only store elements of type `Bool`, however, if you request a
508+
Since `BitArray`s can only store elements of type [`Bool`](@ref), however, if you request a
502509
different element type it will create a regular `Array` instead:
503510
504-
```julia
511+
```julia-repl
505512
julia> similar(falses(10), Float64, 2, 4)
506513
2×4 Array{Float64,2}:
507514
2.18425e-314 2.18425e-314 2.18425e-314 2.18425e-314

base/array.jl

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,22 @@ import Core: arraysize, arrayset, arrayref
5353
Array{T,N}(dims)
5454
5555
Construct an uninitialized `N`-dimensional dense array with element type `T`,
56-
where `N` is determined from the length or number of `dims`. `dims` may
56+
where `N` is determined from the length or number of `dims`. `dims` may
5757
be a tuple or a series of integer arguments corresponding to the lengths in each dimension.
5858
If the rank `N` is supplied explicitly as in `Array{T,N}(dims)`, then it must
5959
match the length or number of `dims`.
60+
61+
# Example
62+
63+
```jldoctest
64+
julia> A = Array{Float64, 2}(2, 2);
65+
66+
julia> ndims(A)
67+
2
68+
69+
julia> eltype(A)
70+
Float64
71+
```
6072
"""
6173
Array
6274

@@ -259,7 +271,7 @@ end
259271
eye([T::Type=Float64,] m::Integer, n::Integer)
260272
261273
`m`-by-`n` identity matrix.
262-
The default element type is `Float64`.
274+
The default element type is [`Float64`](@ref).
263275
"""
264276
function eye(::Type{T}, m::Integer, n::Integer) where T
265277
a = zeros(T,m,n)
@@ -280,7 +292,7 @@ eye(::Type{T}, n::Integer) where {T} = eye(T, n, n)
280292
eye([T::Type=Float64,] n::Integer)
281293
282294
`n`-by-`n` identity matrix.
283-
The default element type is `Float64`.
295+
The default element type is [`Float64`](@ref).
284296
"""
285297
eye(n::Integer) = eye(Float64, n)
286298

@@ -706,7 +718,7 @@ julia> resize!([6, 5, 4, 3, 2, 1], 3)
706718
4
707719
```
708720
709-
```julia
721+
```julia-repl
710722
julia> resize!([6, 5, 4, 3, 2, 1], 8)
711723
8-element Array{Int64,1}:
712724
6
@@ -853,8 +865,8 @@ julia> deleteat!([6, 5, 4, 3, 2, 1], [true, false, true, false, true, false])
853865
julia> deleteat!([6, 5, 4, 3, 2, 1], (2, 2))
854866
ERROR: ArgumentError: indices must be unique and sorted
855867
Stacktrace:
856-
[1] _deleteat!(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./array.jl:873
857-
[2] deleteat!(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./array.jl:860
868+
[1] _deleteat!(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./array.jl:885
869+
[2] deleteat!(::Array{Int64,1}, ::Tuple{Int64,Int64}) at ./array.jl:872
858870
```
859871
"""
860872
deleteat!(a::Vector, inds) = _deleteat!(a, inds)

0 commit comments

Comments
 (0)