Skip to content

Commit

Permalink
Merge pull request #33499 from JuliaLang/backports-release-1.3
Browse files Browse the repository at this point in the history
Backports for Julia 1.3-RC4
  • Loading branch information
KristofferC authored Oct 14, 2019
2 parents b5ccd0f + 40d8a1a commit cf648f7
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 23 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBSSH2) += libssh2
JL_PRIVATE_LIBS-$(USE_SYSTEM_MBEDTLS) += libmbedtls libmbedcrypto libmbedx509
JL_PRIVATE_LIBS-$(USE_SYSTEM_CURL) += libcurl
JL_PRIVATE_LIBS-$(USE_SYSTEM_LIBGIT2) += libgit2
ifeq ($(OS),WINNT)
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += zlib
else
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz
endif
ifeq ($(USE_LLVM_SHLIB),1)
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-6
endif
Expand Down Expand Up @@ -293,9 +298,6 @@ endif
-$(INSTALL_M) $(build_bindir)/libopenlibm.dll.a $(DESTDIR)$(libdir)/
else

# Install `7z` into libexec/
$(INSTALL_M) $(build_bindir)/7z $(DESTDIR)$(libexecdir)/

# Copy over .dSYM directories directly for Darwin
ifneq ($(DARWIN_FRAMEWORK),1)
ifeq ($(OS),Darwin)
Expand Down Expand Up @@ -325,6 +327,7 @@ ifeq ($(BUNDLE_DEBUG_LIBS),1)
@$(DSYMUTIL) -o $(DESTDIR)$(prefix)/$(framework_resources)/sys-debug.dylib.dSYM $(build_private_libdir)/sys-debug.dylib
endif
endif

for suffix in $(JL_PRIVATE_LIBS-0) ; do \
for lib in $(build_libdir)/$${suffix}.*$(SHLIB_EXT)*; do \
if [ "$${lib##*.}" != "dSYM" ]; then \
Expand All @@ -337,6 +340,8 @@ endif
$(INSTALL_M) $$lib $(DESTDIR)$(private_libdir) ; \
done
endif
# Install `7z` into libexec/
$(INSTALL_M) $(build_bindir)/7z$(EXE) $(DESTDIR)$(libexecdir)/

# Copy public headers
cp -R -L $(build_includedir)/julia/* $(DESTDIR)$(includedir)/julia
Expand Down
10 changes: 5 additions & 5 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1190,13 +1190,13 @@ mightalias(A::AbstractArray, B::AbstractArray) = !isbits(A) && !isbits(B) && !_i
mightalias(x, y) = false

_isdisjoint(as::Tuple{}, bs::Tuple{}) = true
_isdisjoint(as::Tuple{}, bs::Tuple{Any}) = true
_isdisjoint(as::Tuple{}, bs::Tuple{UInt}) = true
_isdisjoint(as::Tuple{}, bs::Tuple) = true
_isdisjoint(as::Tuple{Any}, bs::Tuple{}) = true
_isdisjoint(as::Tuple{Any}, bs::Tuple{Any}) = as[1] != bs[1]
_isdisjoint(as::Tuple{Any}, bs::Tuple) = !(as[1] in bs)
_isdisjoint(as::Tuple{UInt}, bs::Tuple{}) = true
_isdisjoint(as::Tuple{UInt}, bs::Tuple{UInt}) = as[1] != bs[1]
_isdisjoint(as::Tuple{UInt}, bs::Tuple) = !(as[1] in bs)
_isdisjoint(as::Tuple, bs::Tuple{}) = true
_isdisjoint(as::Tuple, bs::Tuple{Any}) = !(bs[1] in as)
_isdisjoint(as::Tuple, bs::Tuple{UInt}) = !(bs[1] in as)
_isdisjoint(as::Tuple, bs::Tuple) = !(as[1] in bs) && _isdisjoint(tail(as), bs)

"""
Expand Down
2 changes: 1 addition & 1 deletion base/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ Base.@propagate_inbounds _newindex(ax::Tuple{}, I::Tuple{}) = ()
@inline function _newindexer(indsA::Tuple)
ind1 = indsA[1]
keep, Idefault = _newindexer(tail(indsA))
(Base.length(ind1)!=1, keep...), (first(ind1), Idefault...)
(Base.length(ind1)::Integer != 1, keep...), (first(ind1), Idefault...)
end

@inline function Base.getindex(bc::Broadcasted, I::Union{Integer,CartesianIndex})
Expand Down
8 changes: 7 additions & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@ function instanceof_tfunc(@nospecialize(t))
elseif isa(t, UnionAll)
t′ = unwrap_unionall(t)
t′′, isexact = instanceof_tfunc(t′)
return rewrap_unionall(t′′, t), isexact
tr = rewrap_unionall(t′′, t)
if t′′ isa DataType && !has_free_typevars(tr)
# a real instance must be within the declared bounds of the type,
# so we can intersect with the original wrapper.
tr = typeintersect(tr, t′′.name.wrapper)
end
return tr, isexact
elseif isa(t, Union)
ta, isexact_a = instanceof_tfunc(t.a)
tb, isexact_b = instanceof_tfunc(t.b)
Expand Down
6 changes: 3 additions & 3 deletions base/namedtuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Construct a named tuple with the given `names` (a tuple of Symbols) and field ty
(a `Tuple` type) from a tuple of values.
"""
@eval function NamedTuple{names,T}(args::Tuple) where {names, T <: Tuple}
if length(args) != length(names)
if length(args) != length(names::Tuple)
throw(ArgumentError("Wrong number of arguments to named tuple constructor."))
end
# Note T(args) might not return something of type T; e.g.
Expand Down Expand Up @@ -263,8 +263,8 @@ julia> merge((a=1, b=2, c=3), [:b=>4, :d=>5])
function merge(a::NamedTuple, itr)
names = Symbol[]
vals = Any[]
inds = IdDict()
for (k,v) in itr
inds = IdDict{Symbol,Int}()
for (k::Symbol, v) in itr
oldind = get(inds, k, 0)
if oldind > 0
vals[oldind] = v
Expand Down
5 changes: 3 additions & 2 deletions base/ntuple.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ ntuple(f, ::Val{3}) = (@_inline_meta; (f(1), f(2), f(3)))
end
end

@inline function fill_to_length(t::Tuple, val, ::Val{N}) where {N}
@inline function fill_to_length(t::Tuple, val, ::Val{_N}) where {_N}
M = length(t)
N = _N::Int
M > N && throw(ArgumentError("input tuple of length $M, requested $N"))
if @generated
quote
(t..., $(fill(:val, N-length(t.parameters))...))
(t..., $(fill(:val, (_N::Int) - length(t.parameters))...))
end
else
(t..., fill(val, N-M)...)
Expand Down
2 changes: 1 addition & 1 deletion base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function fieldname(t::DataType, i::Integer)
throw(ArgumentError("type does not have definite field names"))
end
names = _fieldnames(t)
n_fields = length(names)
n_fields = length(names)::Int
field_label = n_fields == 1 ? "field" : "fields"
i > n_fields && throw(ArgumentError("Cannot access field $i since type $t only has $n_fields $field_label."))
i < 1 && throw(ArgumentError("Field numbers must be positive integers. $i is invalid."))
Expand Down
2 changes: 1 addition & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ end
function show_datatype(io::IO, x::DataType)
istuple = x.name === Tuple.name
if (!isempty(x.parameters) || istuple) && x !== Tuple
n = length(x.parameters)
n = length(x.parameters)::Int

# Print homogeneous tuples with more than 3 elements compactly as NTuple{N, T}
if istuple && n > 3 && all(i -> (x.parameters[1] === i), x.parameters)
Expand Down
4 changes: 2 additions & 2 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ ifeq ($(USE_SYSTEM_UTF8PROC), 0)
DEP_LIBS += utf8proc
endif

ifeq ($(USE_SYSTEM_LIBZ), 0)
DEP_LIBS += libz
ifeq ($(USE_SYSTEM_ZLIB), 0)
DEP_LIBS += zlib
endif

ifeq ($(USE_SYSTEM_P7ZIP), 0)
Expand Down
2 changes: 1 addition & 1 deletion deps/Versions.make
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ LIBUV_BB_REL = 0
OBJCONV_VER = 2.49.0
OBJCONV_BB_REL = 0
ZLIB_VER = 1.2.11
ZLIB_BB_REL = 3
ZLIB_BB_REL = 6
P7ZIP_VER = 16.2.0
P7ZIP_BB_REL = 1

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fef000e6d59a8d47c58fd38d83c3ae51
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bfec28c1bfb906c44f91129074b44a795cb99bd971c60dd43abc74962e22ebef0e808039ded2345b7eb8ea42b4c8427b787a276642f0d27f96408e92c3f01bda

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion stdlib/Pkg.version
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
PKG_BRANCH = master
PKG_SHA1 = 7fc471e0501db9108ee5d907dbb2f1878c93c794
PKG_SHA1 = 5de608c7b1837a24ed84eaaa14dde017986cb460
3 changes: 3 additions & 0 deletions test/compiler/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2442,3 +2442,6 @@ f31974(n::Int) = f31974(1:n)
# This query hangs if type inference improperly attempts to const prop
# call cycles.
@test code_typed(f31974, Tuple{Int}) !== nothing

f_overly_abstract_complex() = Complex(Ref{Number}(1)[])
@test Base.return_types(f_overly_abstract_complex, Tuple{}) == [Complex]

0 comments on commit cf648f7

Please sign in to comment.