Skip to content

Commit ec31c9a

Browse files
authored
Merge pull request #35229 from JuliaLang/backports-release-1.4.1
Backports for Julia 1.4.1
2 parents b8e9a9e + 7bd73b6 commit ec31c9a

File tree

347 files changed

+1022
-341
lines changed

Some content is hidden

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

347 files changed

+1022
-341
lines changed

HISTORY.md

Lines changed: 1 addition & 0 deletions

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ else
179179
JL_PRIVATE_LIBS-$(USE_SYSTEM_ZLIB) += libz
180180
endif
181181
ifeq ($(USE_LLVM_SHLIB),1)
182-
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-8
182+
JL_PRIVATE_LIBS-$(USE_SYSTEM_LLVM) += libLLVM libLLVM-8jl
183183
endif
184184

185185
ifeq ($(USE_SYSTEM_LIBM),0)

base/abstractdict.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ Modifies `dict` by transforming each value from `val` to `f(val)`.
713713
Note that the type of `dict` cannot be changed: if `f(val)` is not an instance of the value type
714714
of `dict` then it will be converted to the value type if possible and otherwise raise an error.
715715
716+
!!! compat "Julia 1.2"
717+
`map!(f, values(dict::AbstractDict))` requires Julia 1.2 or later.
718+
716719
# Examples
717720
```jldoctest
718721
julia> d = Dict(:a => 1, :b => 2)

base/array.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,8 @@ end
697697
function setindex_widen_up_to(dest::AbstractArray{T}, el, i) where T
698698
@_inline_meta
699699
new = similar(dest, promote_typejoin(T, typeof(el)))
700-
copyto!(new, firstindex(new), dest, firstindex(dest), i-1)
700+
f = first(LinearIndices(dest))
701+
copyto!(new, first(LinearIndices(new)), dest, f, i-f)
701702
@inbounds new[i] = el
702703
return new
703704
end

base/compiler/abstractinterpretation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@ function abstract_call_known(@nospecialize(f), fargs::Union{Nothing,Vector{Any}}
841841
elseif la == 3 && istopfunction(f, :(>:))
842842
# mark issupertype as a exact alias for issubtype
843843
# swap T1 and T2 arguments and call <:
844-
if length(fargs) == 3
844+
if fargs !== nothing && length(fargs) == 3
845845
fargs = Any[<:, fargs[3], fargs[2]]
846846
else
847847
fargs = nothing

base/compiler/optimize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ intrinsic_effect_free_if_nothrow(f) = f === Intrinsics.pointerref || is_pure_int
275275
plus_saturate(x::Int, y::Int) = max(x, y, x+y)
276276

277277
# known return type
278-
isknowntype(@nospecialize T) = (T === Union{}) || isconcretetype(T)
278+
isknowntype(@nospecialize T) = (T === Union{}) || isa(T, Const) || isconcretetype(widenconst(T))
279279

280280
function statement_cost(ex::Expr, line::Int, src::CodeInfo, sptypes::Vector{Any}, slottypes::Vector{Any}, params::Params)
281281
head = ex.head

base/compiler/ssair/inlining.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ function analyze_method!(idx::Int, sig::Signature, @nospecialize(metharg), meths
682682
# Check if we intersect any of this method's ambiguities
683683
# TODO: We could split out the ambiguous case as another "union split" case.
684684
# For now, we just reject the method
685-
if method.ambig !== nothing
685+
if method.ambig !== nothing && invoke_data === nothing
686686
for entry::Core.TypeMapEntry in method.ambig
687687
if typeintersect(sig.atype, entry.sig) !== Bottom
688688
return nothing

base/deepcopy.jl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ independent object. For example, deep-copying an array produces a new array whos
1313
are deep copies of the original elements. Calling `deepcopy` on an object should generally
1414
have the same effect as serializing and then deserializing it.
1515
16-
As a special case, functions can only be actually deep-copied if they are anonymous,
17-
otherwise they are just copied. The difference is only relevant in the case of closures,
18-
i.e. functions which may contain hidden internal references.
19-
2016
While it isn't normally necessary, user-defined types can override the default `deepcopy`
2117
behavior by defining a specialized version of the function
2218
`deepcopy_internal(x::T, dict::IdDict)` (which shouldn't otherwise be used),

base/errorshow.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ function showerror(io::IO, ex::MethodError)
232232
kwargs = pairs(ex.args[1])
233233
ex = MethodError(f, ex.args[3:end])
234234
end
235-
if f == Base.convert && length(arg_types_param) == 2 && !is_arg_types
235+
if f === Base.convert && length(arg_types_param) == 2 && !is_arg_types
236236
f_is_function = true
237237
show_convert_error(io, ex, arg_types_param)
238238
elseif isempty(methods(f)) && isa(f, DataType) && f.abstract
@@ -716,4 +716,3 @@ function show(io::IO, ip::InterpreterIP)
716716
print(io, " in $(ip.code) at statement $(Int(ip.stmt))")
717717
end
718718
end
719-

base/file.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ function rm(path::AbstractString; force::Bool=false, recursive::Bool=false)
261261
try
262262
@static if Sys.iswindows()
263263
# is writable on windows actually means "is deletable"
264-
if (filemode(path) & 0o222) == 0
264+
if (filemode(lstat(path)) & 0o222) == 0
265265
chmod(path, 0o777)
266266
end
267267
end
@@ -853,10 +853,13 @@ function walkdir(root; topdown=true, follow_symlinks=false, onerror=throw)
853853
dirs = Vector{eltype(content)}()
854854
files = Vector{eltype(content)}()
855855
for name in content
856-
if isdir(joinpath(root, name))
857-
push!(dirs, name)
858-
else
856+
path = joinpath(root, name)
857+
858+
# If we're not following symlinks, then treat all symlinks as files
859+
if (!follow_symlinks && islink(path)) || !isdir(path)
859860
push!(files, name)
861+
else
862+
push!(dirs, name)
860863
end
861864
end
862865

0 commit comments

Comments
 (0)