Skip to content
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

Backports for 1.10.6 #55746

Merged
merged 35 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
21ccfc0
mapreduce: don't inbounds unknown functions (#55329)
mbauman Aug 2, 2024
84139ed
ml-matches: ensure all methods are included (#55365)
vtjnash Aug 8, 2024
ecdbb39
fix hierarchy level of "API reference" in `Dates` documentation (#55483)
matthias314 Aug 13, 2024
75436e4
simplify complex atanh and remove singularity perturbation (#55268)
oscardssmith Aug 13, 2024
f4eda2d
Update symmetric docstring to reflect the type of uplo (#55504)
jishnub Aug 17, 2024
c7f5f2d
Set `.jl` sources as read-only during installation (#55524)
staticfloat Aug 19, 2024
c5ab7c9
[release-1.10] dont reset maxsize in jl_array_to_string (#55689)
d-netto Sep 12, 2024
f21154f
Root globals in toplevel exprs (#54433)
gbaraldi Sep 25, 2024
242f704
Fix some corner cases of `isapprox` with unsigned integers (#55828)
giordano Sep 26, 2024
204b0b9
inference: add missing `TypeVar` handling for `instanceof_tfunc` (#55…
aviatesk Sep 27, 2024
c3490ed
Avoid `stat`-ing stdlib path if it's unreadable (#55980)
giordano Oct 4, 2024
16462c5
🤖 [backports-release-1.10] Bump the Pkg stdlib from edfa2ed0e to e2f4…
DilumAluthgeBot Oct 5, 2024
f3257a0
build: ASAN fixes for glibc (#51755)
maleadt Nov 20, 2023
812cbc9
Fix shell `cd` error when working dir has been deleted (#41244)
norci Sep 17, 2024
c5caf18
[Dates] Make test more robust against non-UTC timezones (#55829)
giordano Sep 22, 2024
d2e5c8f
fall back to slower stat filesize if optimized filesize fails (#55641)
IanButterworth Sep 23, 2024
dcf8f65
Mmap: fix grow! for non file IOs (#55849)
IanButterworth Sep 24, 2024
f86b11f
Fix logic in `?` docstring example (#55945)
IanButterworth Oct 1, 2024
ec1d55a
Profile: document heap snapshot viewing tools (#55743)
nsajko Oct 5, 2024
56e1364
Sockets: Warn when local network access not granted. (#56023)
maleadt Oct 7, 2024
2d6e88f
Fix solve for complex `Hermitian` with non-vanishing imaginary part …
dkarrasch Apr 27, 2024
36ff239
Improve error message in inplace transpose (#54669)
jishnub Jun 4, 2024
beb0c7d
LAPACK: Aggressive constprop to concretely infer syev!/syevd! (#55295)
jishnub Jul 30, 2024
a620a4e
avoid overflowing show for OffsetArrays around typemax (#55303)
mbauman Jul 31, 2024
4b55053
Ensure bidiagonal setindex! does not read indices in error message (#…
jishnub Aug 3, 2024
fa29d0a
Fix fast getptls ccall lowering. (#55507)
gbaraldi Aug 16, 2024
5036b77
Fix tr for Symmetric/Hermitian block matrices (#55522)
jishnub Aug 19, 2024
c3ea488
🤖 [master] Bump the Downloads stdlib from 1061ecc to 89d3c7d (#55854)
DilumAluthgeBot Sep 24, 2024
0ccb8b6
Update TaskLocalRNG docstring according to #49110 (#55863)
danielwe Sep 25, 2024
4d46082
Initialize threadpools correctly during sysimg build (#55567)
gbaraldi Aug 27, 2024
cecd5f2
Fix indexing in _mapreducedim for OffsetArrays (#55506)
jishnub Aug 23, 2024
55a30d5
LazyString in interpolated error messages involving types (#54737)
jishnub Jun 10, 2024
3ba6c16
remove test that doesn't apply to 1.10
KristofferC Oct 16, 2024
25ee4ea
[LinearAlgebra] Remove unreliable doctests (#56011)
giordano Oct 6, 2024
ecf3a5d
bump Pkg to latest 1.10
Oct 18, 2024
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
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@ endif
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia

# Set .jl sources as read-only to match package directories
find $(DESTDIR)$(datarootdir)/julia/base -type f -name \*.jl -exec chmod 0444 '{}' \;
find $(DESTDIR)$(datarootdir)/julia/test -type f -name \*.jl -exec chmod 0444 '{}' \;

# Copy documentation
cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
# Remove various files which should not be installed
Expand Down
21 changes: 11 additions & 10 deletions base/Enums.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ end
# give Enum types scalar behavior in broadcasting
Base.broadcastable(x::Enum) = Ref(x)

@noinline enum_argument_error(typename, x) = throw(ArgumentError(string("invalid value for Enum $(typename): $x")))
@noinline enum_argument_error(typename, x) = throw(ArgumentError(LazyString("invalid value for Enum ", typename, ": ", x)))

"""
@enum EnumName[::BaseType] value1[=x] value2[=y]
Expand Down Expand Up @@ -143,18 +143,19 @@ julia> Symbol(apple)
"""
macro enum(T::Union{Symbol,Expr}, syms...)
if isempty(syms)
throw(ArgumentError("no arguments given for Enum $T"))
throw(ArgumentError(LazyString("no arguments given for Enum ", T)))
end
basetype = Int32
typename = T
if isa(T, Expr) && T.head === :(::) && length(T.args) == 2 && isa(T.args[1], Symbol)
typename = T.args[1]
basetype = Core.eval(__module__, T.args[2])
if !isa(basetype, DataType) || !(basetype <: Integer) || !isbitstype(basetype)
throw(ArgumentError("invalid base type for Enum $typename, $T=::$basetype; base type must be an integer primitive type"))
throw(ArgumentError(
LazyString("invalid base type for Enum ", typename, ", ", T, "=::", basetype, "; base type must be an integer primitive type")))
end
elseif !isa(T, Symbol)
throw(ArgumentError("invalid type expression for enum $T"))
throw(ArgumentError(LazyString("invalid type expression for enum ", T)))
end
values = Vector{basetype}()
seen = Set{Symbol}()
Expand All @@ -169,32 +170,32 @@ macro enum(T::Union{Symbol,Expr}, syms...)
s isa LineNumberNode && continue
if isa(s, Symbol)
if i == typemin(basetype) && !isempty(values)
throw(ArgumentError("overflow in value \"$s\" of Enum $typename"))
throw(ArgumentError(LazyString("overflow in value \"", s, "\" of Enum ", typename)))
end
elseif isa(s, Expr) &&
(s.head === :(=) || s.head === :kw) &&
length(s.args) == 2 && isa(s.args[1], Symbol)
i = Core.eval(__module__, s.args[2]) # allow exprs, e.g. uint128"1"
if !isa(i, Integer)
throw(ArgumentError("invalid value for Enum $typename, $s; values must be integers"))
throw(ArgumentError(LazyString("invalid value for Enum ", typename, ", ", s, "; values must be integers")))
end
i = convert(basetype, i)
s = s.args[1]
hasexpr = true
else
throw(ArgumentError(string("invalid argument for Enum ", typename, ": ", s)))
throw(ArgumentError(LazyString("invalid argument for Enum ", typename, ": ", s)))
end
s = s::Symbol
if !Base.isidentifier(s)
throw(ArgumentError("invalid name for Enum $typename; \"$s\" is not a valid identifier"))
throw(ArgumentError(LazyString("invalid name for Enum ", typename, "; \"", s, "\" is not a valid identifier")))
end
if hasexpr && haskey(namemap, i)
throw(ArgumentError("both $s and $(namemap[i]) have value $i in Enum $typename; values must be unique"))
throw(ArgumentError(LazyString("both ", s, " and ", namemap[i], " have value ", i, " in Enum ", typename, "; values must be unique")))
end
namemap[i] = s
push!(values, i)
if s in seen
throw(ArgumentError("name \"$s\" in Enum $typename is not unique"))
throw(ArgumentError(LazyString("name \"", s, "\" in Enum ", typename, " is not unique")))
end
push!(seen, s)
if length(values) == 1
Expand Down
17 changes: 9 additions & 8 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -756,8 +756,7 @@ julia> checkindex(Bool, 1:20, 21)
false
```
"""
checkindex(::Type{Bool}, inds::AbstractUnitRange, i) =
throw(ArgumentError("unable to check bounds for indices of type $(typeof(i))"))
checkindex(::Type{Bool}, inds::AbstractUnitRange, i) = throw(ArgumentError(LazyString("unable to check bounds for indices of type ", typeof(i))))
checkindex(::Type{Bool}, inds::AbstractUnitRange, i::Real) = (first(inds) <= i) & (i <= last(inds))
checkindex(::Type{Bool}, inds::IdentityUnitRange, i::Real) = checkindex(Bool, inds.indices, i)
checkindex(::Type{Bool}, inds::OneTo{T}, i::T) where {T<:BitInteger} = unsigned(i - one(i)) < unsigned(last(inds))
Expand Down Expand Up @@ -1497,12 +1496,14 @@ much more common case where aliasing does not occur. By default,
unaliascopy(A::Array) = copy(A)
unaliascopy(A::AbstractArray)::typeof(A) = (@noinline; _unaliascopy(A, copy(A)))
_unaliascopy(A::T, C::T) where {T} = C
_unaliascopy(A, C) = throw(ArgumentError("""
an array of type `$(typename(typeof(A)).wrapper)` shares memory with another argument
and must make a preventative copy of itself in order to maintain consistent semantics,
but `copy(::$(typeof(A)))` returns a new array of type `$(typeof(C))`.
To fix, implement:
`Base.unaliascopy(A::$(typename(typeof(A)).wrapper))::typeof(A)`"""))
function _unaliascopy(A, C)
Aw = typename(typeof(A)).wrapper
throw(ArgumentError(LazyString("an array of type `", Aw, "` shares memory with another argument ",
"and must make a preventative copy of itself in order to maintain consistent semantics, ",
"but `copy(::", typeof(A), ")` returns a new array of type `", typeof(C), "`.\n",
"""To fix, implement:
`Base.unaliascopy(A::""", Aw, ")::typeof(A)`")))
end
unaliascopy(A) = A

"""
Expand Down
2 changes: 1 addition & 1 deletion base/c.jl
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ function ccall_macro_lower(convention, func, rettype, types, args, nreq)
check = quote
if !isa(func, Ptr{Cvoid})
name = $name
throw(ArgumentError("interpolated function `$name` was not a Ptr{Cvoid}, but $(typeof(func))"))
throw(ArgumentError(LazyString("interpolated function `", name, "` was not a Ptr{Cvoid}, but ", typeof(func))))
end
end
push!(statements, check)
Expand Down
13 changes: 9 additions & 4 deletions base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function repl_cmd(cmd, out)
if isempty(cmd.exec)
throw(ArgumentError("no cmd to execute"))
elseif cmd.exec[1] == "cd"
new_oldpwd = pwd()
if length(cmd.exec) > 2
throw(ArgumentError("cd method only takes one argument"))
elseif length(cmd.exec) == 2
Expand All @@ -51,11 +50,17 @@ function repl_cmd(cmd, out)
end
dir = ENV["OLDPWD"]
end
cd(dir)
else
cd()
dir = homedir()
end
ENV["OLDPWD"] = new_oldpwd
try
ENV["OLDPWD"] = pwd()
catch ex
ex isa IOError || rethrow()
# if current dir has been deleted, then pwd() will throw an IOError: pwd(): no such file or directory (ENOENT)
delete!(ENV, "OLDPWD")
end
cd(dir)
println(out, pwd())
else
@static if !Sys.iswindows()
Expand Down
8 changes: 4 additions & 4 deletions base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ function instanceof_tfunc(@nospecialize(t), @nospecialize(troot) = t)
end
return tr, isexact, isconcrete, istype
elseif isa(t, Union)
ta, isexact_a, isconcrete_a, istype_a = instanceof_tfunc(t.a, troot)
tb, isexact_b, isconcrete_b, istype_b = instanceof_tfunc(t.b, troot)
ta, isexact_a, isconcrete_a, istype_a = instanceof_tfunc(unwraptv(t.a), troot)
tb, isexact_b, isconcrete_b, istype_b = instanceof_tfunc(unwraptv(t.b), troot)
isconcrete = isconcrete_a && isconcrete_b
istype = istype_a && istype_b
# most users already handle the Union case, so here we assume that
Expand Down Expand Up @@ -536,9 +536,9 @@ add_tfunc(Core.sizeof, 1, 1, sizeof_tfunc, 1)
end
end
if isa(x, Union)
na = nfields_tfunc(𝕃, x.a)
na = nfields_tfunc(𝕃, unwraptv(x.a))
na === Int && return Int
return tmerge(na, nfields_tfunc(𝕃, x.b))
return tmerge(𝕃, na, nfields_tfunc(𝕃, unwraptv(x.b)))
end
return Int
end
Expand Down
17 changes: 7 additions & 10 deletions base/complex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1028,24 +1028,22 @@ end
function atanh(z::Complex{T}) where T
z = float(z)
Tf = float(T)
Ω = prevfloat(typemax(Tf))
θ = sqrt(Ω)/4
ρ = 1/θ
x, y = reim(z)
ax = abs(x)
ay = abs(y)
θ = sqrt(floatmax(Tf))/4
if ax > θ || ay > θ #Prevent overflow
if isnan(y)
if isinf(x)
return Complex(copysign(zero(x),x), y)
else
return Complex(real(1/z), y)
return Complex(real(inv(z)), y)
end
end
if isinf(y)
return Complex(copysign(zero(x),x), copysign(oftype(y,pi)/2, y))
end
return Complex(real(1/z), copysign(oftype(y,pi)/2, y))
return Complex(real(inv(z)), copysign(oftype(y,pi)/2, y))
end
β = copysign(one(Tf), x)
z *= β
Expand All @@ -1055,16 +1053,15 @@ function atanh(z::Complex{T}) where T
ξ = oftype(x, Inf)
η = y
else
ym = ay+ρ
ξ = log(sqrt(sqrt(4+y*y))/sqrt(ym))
η = copysign(oftype(y,pi)/2 + atan(ym/2), y)/2
ξ = log(sqrt(sqrt(muladd(y, y, 4)))/sqrt(ay))
η = copysign(oftype(y,pi)/2 + atan(ay/2), y)/2
end
else #Normal case
ysq = (ay+ρ)^2
ysq = ay^2
if x == 0
ξ = x
else
ξ = log1p(4x/((1-x)^2 + ysq))/4
ξ = log1p(4x/(muladd(1-x, 1-x, ysq)))/4
end
η = angle(Complex((1-x)*(1+x)-ysq, 2y))/2
end
Expand Down
9 changes: 6 additions & 3 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -916,11 +916,14 @@ expression, rather than the side effects that evaluating `b` or `c` may have.
See the manual section on [control flow](@ref man-conditional-evaluation) for more details.

# Examples
```
```jldoctest
julia> x = 1; y = 2;

julia> x > y ? println("x is larger") : println("y is larger")
y is larger
julia> x > y ? println("x is larger") : println("x is not larger")
x is not larger

julia> x > y ? "x is larger" : x == y ? "x and y are equal" : "y is larger"
"y is larger"
```
"""
kw"?", kw"?:"
Expand Down
4 changes: 3 additions & 1 deletion base/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ function isapprox(x::Integer, y::Integer;
if norm === abs && atol < 1 && rtol == 0
return x == y
else
return norm(x - y) <= max(atol, rtol*max(norm(x), norm(y)))
# We need to take the difference `max` - `min` when comparing unsigned integers.
_x, _y = x < y ? (x, y) : (y, x)
return norm(_y - _x) <= max(atol, rtol*max(norm(_x), norm(_y)))
end
end

Expand Down
4 changes: 2 additions & 2 deletions base/indices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,9 @@ to_index(I::AbstractArray{Bool}) = LogicalIndex(I)
to_index(I::AbstractArray) = I
to_index(I::AbstractArray{Union{}}) = I
to_index(I::AbstractArray{<:Union{AbstractArray, Colon}}) =
throw(ArgumentError("invalid index: $(limitrepr(I)) of type $(typeof(I))"))
throw(ArgumentError(LazyString("invalid index: ", limitrepr(I), " of type ", typeof(I))))
to_index(::Colon) = throw(ArgumentError("colons must be converted by to_indices(...)"))
to_index(i) = throw(ArgumentError("invalid index: $(limitrepr(i)) of type $(typeof(i))"))
to_index(i) = throw(ArgumentError(LazyString("invalid index: ", limitrepr(i), " of type ", typeof(i))))

# The general to_indices is mostly defined in multidimensional.jl, but this
# definition is required for bootstrap:
Expand Down
4 changes: 2 additions & 2 deletions base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ julia> bitstring(2.2)
```
"""
function bitstring(x::T) where {T}
isprimitivetype(T) || throw(ArgumentError("$T not a primitive type"))
isprimitivetype(T) || throw(ArgumentError(LazyString(T, " not a primitive type")))
sz = sizeof(T) * 8
str = StringVector(sz)
i = sz
Expand Down Expand Up @@ -1016,7 +1016,7 @@ julia> digits!([2, 2, 2, 2, 2, 2], 10, base = 2)
function digits!(a::AbstractVector{T}, n::Integer; base::Integer = 10) where T<:Integer
2 <= abs(base) || throw(DomainError(base, "base must be ≥ 2 or ≤ -2"))
hastypemax(T) && abs(base) - 1 > typemax(T) &&
throw(ArgumentError("type $T too small for base $base"))
throw(ArgumentError(LazyString("type ", T, " too small for base ", base)))
isempty(a) && return a

if base > 0
Expand Down
2 changes: 1 addition & 1 deletion base/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ previously marked position. Throw an error if the stream is not marked.
See also [`mark`](@ref), [`unmark`](@ref), [`ismarked`](@ref).
"""
function reset(io::T) where T<:IO
ismarked(io) || throw(ArgumentError("$T not marked"))
ismarked(io) || throw(ArgumentError(LazyString(T, " not marked")))
m = io.mark
seek(io, m)
io.mark = -1 # must be after seek, or seek may fail
Expand Down
4 changes: 2 additions & 2 deletions base/iostream.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ end
function filesize(s::IOStream)
sz = @_lock_ios s ccall(:ios_filesize, Int64, (Ptr{Cvoid},), s.ios)
if sz == -1
err = Libc.errno()
throw(IOError(string("filesize: ", Libc.strerror(err), " for ", s.name), err))
# if `s` is not seekable `ios_filesize` can fail, so fall back to slower stat method
sz = filesize(stat(s))
end
return sz
end
Expand Down
6 changes: 3 additions & 3 deletions base/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using .Base:
AbstractRange, AbstractUnitRange, UnitRange, LinearIndices, TupleOrBottom,
(:), |, +, -, *, !==, !, ==, !=, <=, <, >, >=, missing,
any, _counttuple, eachindex, ntuple, zero, prod, reduce, in, firstindex, lastindex,
tail, fieldtypes, min, max, minimum, zero, oneunit, promote, promote_shape
tail, fieldtypes, min, max, minimum, zero, oneunit, promote, promote_shape, LazyString
using Core: @doc

if Base !== Core.Compiler
Expand Down Expand Up @@ -1048,15 +1048,15 @@ _prod_size(t::Tuple) = (_prod_size1(t[1], IteratorSize(t[1]))..., _prod_size(tai
_prod_size1(a, ::HasShape) = size(a)
_prod_size1(a, ::HasLength) = (length(a),)
_prod_size1(a, A) =
throw(ArgumentError("Cannot compute size for object of type $(typeof(a))"))
throw(ArgumentError(LazyString("Cannot compute size for object of type ", typeof(a))))

axes(P::ProductIterator) = _prod_indices(P.iterators)
_prod_indices(::Tuple{}) = ()
_prod_indices(t::Tuple) = (_prod_axes1(t[1], IteratorSize(t[1]))..., _prod_indices(tail(t))...)
_prod_axes1(a, ::HasShape) = axes(a)
_prod_axes1(a, ::HasLength) = (OneTo(length(a)),)
_prod_axes1(a, A) =
throw(ArgumentError("Cannot compute indices for object of type $(typeof(a))"))
throw(ArgumentError(LazyString("Cannot compute indices for object of type ", typeof(a))))

ndims(p::ProductIterator) = length(axes(p))
length(P::ProductIterator) = reduce(checked_mul, size(P); init=1)
Expand Down
13 changes: 10 additions & 3 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3115,9 +3115,16 @@ end

# now check if this file is fresh relative to its source files
if !skip_timecheck
if !samefile(includes[1].filename, modpath) && !samefile(fixup_stdlib_path(includes[1].filename), modpath)
@debug "Rejecting cache file $cachefile because it is for file $(includes[1].filename) not file $modpath"
return true # cache file was compiled from a different path
if !samefile(includes[1].filename, modpath)
stdlib_path = fixup_stdlib_path(includes[1].filename)
# In certain cases the path rewritten by `fixup_stdlib_path` may
# point to an unreadable directory, make sure we can `stat` the
# file before comparing it with `modpath`.
isreadable = iszero(@ccall jl_fs_access(stdlib_path::Cstring, 0x04::Cint)::Cint)
if !(isreadable && samefile(stdlib_path, modpath))
@debug "Rejecting cache file $cachefile because it is for file $(includes[1].filename) not file $modpath"
return true # cache file was compiled from a different path
end
end
for (modkey, req_modkey) in requires
# verify that `require(modkey, name(req_modkey))` ==> `req_modkey`
Expand Down
2 changes: 1 addition & 1 deletion base/multidimensional.jl
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ module IteratorsMD
else
# Given the fact that StepRange 1:2:4 === 1:2:3, we lost the original size information
# and thus cannot calculate the correct linear indices when the steps are not 1.
throw(ArgumentError("LinearIndices for $(typeof(inds)) with non-1 step size is not yet supported."))
throw(ArgumentError(LazyString("LinearIndices for ", typeof(inds), " with non-1 step size is not yet supported.")))
end
end

Expand Down
2 changes: 1 addition & 1 deletion base/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function tryparse_internal(::Type{T}, s::AbstractString, raise::Bool; kwargs...)
return result
end
@noinline _parse_failure(T, s::AbstractString, startpos = firstindex(s), endpos = lastindex(s)) =
throw(ArgumentError("cannot parse $(repr(s[startpos:endpos])) as $T"))
throw(ArgumentError(LazyString("cannot parse ", repr(s[startpos:endpos]), " as ", T)))

tryparse_internal(::Type{T}, s::AbstractString, startpos::Int, endpos::Int, raise::Bool) where T<:Integer =
tryparse_internal(T, s, startpos, endpos, 10, raise)
Expand Down
2 changes: 1 addition & 1 deletion base/rational.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ end
checked_den(num::T, den::T) where T<:Integer = checked_den(T, num, den)
checked_den(num::Integer, den::Integer) = checked_den(promote(num, den)...)

@noinline __throw_rational_argerror_zero(T) = throw(ArgumentError("invalid rational: zero($T)//zero($T)"))
@noinline __throw_rational_argerror_zero(T) = throw(ArgumentError(LazyString("invalid rational: zero(", T, ")//zero(", T, ")")))
function Rational{T}(num::Integer, den::Integer) where T<:Integer
iszero(den) && iszero(num) && __throw_rational_argerror_zero(T)
num, den = divgcd(num, den)
Expand Down
10 changes: 5 additions & 5 deletions base/reduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,11 @@ function mapreduce_impl(f, op::Union{typeof(max), typeof(min)},
start = first + 1
simdstop = start + chunk_len - 4
while simdstop <= last - 3
@inbounds for i in start:4:simdstop
v1 = _fast(op, v1, f(A[i+0]))
v2 = _fast(op, v2, f(A[i+1]))
v3 = _fast(op, v3, f(A[i+2]))
v4 = _fast(op, v4, f(A[i+3]))
for i in start:4:simdstop
v1 = _fast(op, v1, f(@inbounds(A[i+0])))
v2 = _fast(op, v2, f(@inbounds(A[i+1])))
v3 = _fast(op, v3, f(@inbounds(A[i+2])))
v4 = _fast(op, v4, f(@inbounds(A[i+3])))
end
checkbounds(A, simdstop+3)
start += chunk_len
Expand Down
Loading