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

WIP: Backports for 1.0.2 #29444

Merged
merged 109 commits into from
Nov 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
7a30fbd
correct the docs of `Nothing` (#29210)
githubtomtom Sep 16, 2018
bba596f
fix digits(n::Unsigned) with neg base for `n > typemax(n)÷2` (#29205)
StefanKarpinski Sep 17, 2018
f664f26
Make `using LinearAlgebra` explicit (#29188)
stillyslalom Sep 17, 2018
a7584a8
fix awkward phrasing in parallel-computing.md
Sep 17, 2018
038b9bb
Base.TCPServer --> Sockets.TCPServer (#29230)
cgay Sep 18, 2018
9cadb4b
Changed one identifier in one example (#29279)
mark-summerfield Sep 20, 2018
20b3cb5
Minor cleanup of noteworthy differences (#29245)
bkamins Sep 21, 2018
6c82eef
Improve description of Julia keywords (#29229)
bkamins Sep 21, 2018
c5f3adc
fix minor typo in parallel-computing.md (#29232)
Sep 21, 2018
829a976
Fix a typo in docs (#29299)
bkamins Sep 21, 2018
08d8221
typo fix in parallel-computing.md (#29319)
Sep 22, 2018
e931f98
fix #29306, teach effect_free that GotoIfNot with non-Bool can throw …
JeffBezanson Sep 22, 2018
10d8327
Improve noteworthy differences from R on ismissing (#29332)
nalimilan Sep 24, 2018
fbd841e
Minor docs correction for maxintfloat. (#29301)
tpapp Sep 24, 2018
639032c
Some misisng paren and xrefs (#29351)
kshyatt Sep 25, 2018
d0710c7
Backticks and xrefs (#29349)
kshyatt Sep 25, 2018
ea37169
avoid conversion from Char to String to Symbol in some LinearAlgebra …
KristofferC Sep 25, 2018
c5b32ae
Minor English fixes in constructors.md (#29338)
mark-summerfield Sep 25, 2018
5addb28
Fix: Complex SubArray times real Matrix (#29246)
jarlebring Sep 25, 2018
69e8fc6
fix #29326, return type lowering interfering with closure optimizatio…
JeffBezanson Sep 25, 2018
2f9e279
always obey inline declarations if the calling signature is concrete …
JeffBezanson Sep 25, 2018
80747f6
fix crash when interpreting optimized top-level expressions (#29217)
JeffBezanson Sep 26, 2018
d67c205
Remove docstring relicts of findlast/findprev for regex (#29398)
laborg Sep 27, 2018
b029b7b
doc: fix not-true-anymore example with promote_rule (#29416)
rfourquet Sep 28, 2018
63384f3
improve findnext/findprev docstring for strings (#29415)
rfourquet Sep 28, 2018
8cc9136
fix #29208, incorrect `Union{}` result from type intersection (#29380)
JeffBezanson Sep 28, 2018
87ef685
fix `sizeof(str::AbstractString)` docstring (#29414)
rfourquet Sep 28, 2018
9e77dbc
Change from parametric T signature to Int32 in _ldexp_exp (#29401)
pkofod Sep 29, 2018
2493934
fix #20872, handle UnionAll types in `which` (#29419)
JeffBezanson Sep 29, 2018
bcc39e2
Fix sentence fragment (#29431)
johnmyleswhite Sep 29, 2018
4778a40
check return from jl_restore_incremental correctly
vchuravy Sep 23, 2018
9a9c4ba
Bump Documenter to v0.19.3 (#28559)
mortenpi Aug 11, 2018
a866a5b
Minor English fixes/improvements (#29391)
mark-summerfield Sep 27, 2018
af50a7e
Some improvements to variables and scoping manual
kshyatt Sep 26, 2018
5653c98
win,init: if stdio is not available, do not exit (#29374)
jaakkor2 Oct 1, 2018
50588bc
Improved English and egs (#29281)
mark-summerfield Oct 1, 2018
f362fb5
Closed issue #29454 (#29475)
don-suth Oct 2, 2018
80a9530
tiny formatting fix on docs (#29463)
dpshelio Oct 2, 2018
aebc33b
correct language in documentation (#29502)
bkamins Oct 3, 2018
b226b2e
fix #29468, bug in intersection of different-length vararg tuples (#2…
JeffBezanson Oct 3, 2018
3cfe9ce
Fix #29451: parse(Int, s::AbstractString) when ncodeunits(s) > lastin…
samoconnor Oct 3, 2018
0e0e629
Add --project option to man page (#29497)
simonbyrne Oct 4, 2018
f35593f
English fixes (#29336)
mark-summerfield Oct 4, 2018
798b4de
Minor English fixes (#29337)
mark-summerfield Oct 4, 2018
4bff8d6
REPL: really fix #29347, searching a string not in history (#29412)
rfourquet Oct 4, 2018
e62e48d
REPL: make paste work in search mode (#29373)
rfourquet Oct 4, 2018
a027a6c
Typo (#29482)
fbruetting Oct 4, 2018
516dde6
REPL: show "failed" when i-search fails, like in readline (#29413)
rfourquet Oct 4, 2018
130af13
Remove unecessary mention of Julia version in docs (#29519)
singularitti Oct 5, 2018
e214319
Fix a typo in parallel computing doc (#29521)
singularitti Oct 5, 2018
d75ebb5
Update performance-tips.md (#29543)
raminammour Oct 6, 2018
28265d9
cleanup history file for generate_precompile (#29068)
iblislin Oct 6, 2018
1a96057
fix bug in parsing extended colon-like operators (#29314)
JeffBezanson Sep 24, 2018
58a651b
fix reinterpret(Char, ::UInt32) for "unnatural" values (fix #29181) (…
StefanKarpinski Sep 17, 2018
2fe2da3
Still set rpath-link in RPATH_ESCAPED_ORIGIN
Keno Oct 2, 2018
765a4c3
Add an option to disable building libssh2 tests
Keno Oct 2, 2018
9b7f28b
Code-format some function names in doc headers (#29485)
blegat Oct 8, 2018
d41f77c
flatten empty tuple - fix #29112 (#29548)
KlausC Oct 8, 2018
b46c362
basedocs: add 'See also' for `getproperty` and `setproperty!` (#29570)
iblislin Oct 9, 2018
1123f0a
Fixing abs for Rational{<:Unsigned} (#29561)
lcontento Oct 9, 2018
c88e33b
fix #29528, specificity transitivity error in DiffEqBase
JeffBezanson Oct 5, 2018
e7aef94
Fix quantile doctest formatting (#29573)
bovine3dom Oct 9, 2018
f1d4dde
Add findlast and findprev examples to strings.md manual (#29019)
royalbhati Oct 10, 2018
0b44f6e
Document Dates.value (#29591)
amellnik Oct 14, 2018
d2238ec
fix an indent in documentation of Mmap.mmap (#29641)
bicycle1885 Oct 15, 2018
fff684c
Workaround subarray test failure due to associativity. (#29386)
cdluminate Oct 15, 2018
84ed14b
Fix typo in arrays.md (#29648)
ckant787 Oct 15, 2018
4a96798
fix #29644: getproperty of Tridiagonal{SparseVector} (#29646)
fredrikekre Oct 16, 2018
a97d40c
fix #29662: missing import from Base.Printf to Printf stdlib. (#29663)
fredrikekre Oct 16, 2018
03ecf81
Use a stable inverse for Tridiagonal and SymTridiagonal (#29667)
andreasnoack Oct 17, 2018
9b2d636
Don't splat a number in ReshapedArray (#29677)
mbauman Oct 17, 2018
e5e3a49
Adjust doc test for \ to avoid rounding (#29689)
andreasnoack Oct 18, 2018
8b1c3ca
Added docs for external profiling (#28538)
fisiognomico Aug 11, 2018
975d690
Fix a typo in profile.md (#29627)
Oct 14, 2018
75e7d05
triu M>N case bugfix
GiggleLiu Oct 18, 2018
d00e343
Upgrade to new Documenter. (#29470)
fredrikekre Oct 3, 2018
f7eeed4
fix jldoctest example in mapreduce(...) (#29604)
thchr Oct 19, 2018
6da9a6c
Uniform scaling cat with zero dimensions (#29457)
mfalt Oct 19, 2018
82ae7e3
Mention that the `=` part of `--project` is optional. Add to regular …
simonbyrne Oct 20, 2018
ba3c39b
Fix bug in nullspace when the matrix is empty (#29725)
andreasnoack Oct 20, 2018
ebbaf5d
convert Integer in Cholesky constructors to BlasInt (#29732)
kleinschmidt Oct 21, 2018
116b091
Fix hashing of Dates.Time. Fixes #29480 (#29742)
JeffBezanson Oct 21, 2018
29c1eb2
punctuation error (#29763)
ckant787 Oct 22, 2018
62ae729
fix #29718, union field alignment (#29722)
JeffBezanson Oct 23, 2018
20a7264
adding _small_enough for Diagonal so that fill! works (#29780)
mcognetta Oct 25, 2018
7d1875b
Fixed for the markdown table in getting-started.md (#29797)
wookay Oct 25, 2018
7bfe65a
clarify pinv documentation (#29793)
stevengj Oct 25, 2018
307f920
Created an actual table [Manual,Scope of Variables] (#29789)
Oct 25, 2018
8ace044
Make tables on Interfaces manual page more consistent (#29703)
oxinabox Oct 25, 2018
1e298f7
Fix out-of-tree build of docs, fix #29757. (#29760)
fredrikekre Oct 25, 2018
5864e7e
Use Documenter release instead of master. (#29830)
fredrikekre Oct 29, 2018
17a45cc
Fix CInt to Cint in docs (#29834)
musm Oct 29, 2018
df5618b
improve performance for ascii (#29609)
KristofferC Oct 16, 2018
13b3983
propgate inbounds to substring and use it in split (#29557)
KristofferC Oct 16, 2018
3dcb8b2
add inbounds to some more substrings (#29680)
KristofferC Oct 18, 2018
8647b96
improve performance for sorting columns in sparse matrix (#29682)
KristofferC Oct 19, 2018
d58ee9f
improve performance for sparse matrix vector indexing (#29696)
KristofferC Oct 22, 2018
e012058
speed up logical indexing by bitarray (#29746)
chethega Oct 24, 2018
14be38f
help type inference for logical indexing (#29633)
chethega Oct 29, 2018
6b11812
Download Pkg from GitHub releases. (#29615)
fredrikekre Oct 27, 2018
87d94ea
fix eval world updates
vtjnash Oct 22, 2018
31234c1
inference: fix egal_tfunc for Conditional
vtjnash Oct 29, 2018
3df1997
inference: fix efficiency of tfunc key lookup
vtjnash Oct 29, 2018
bb6a9af
Make pinv work for Adjoint (#29837)
andreasnoack Oct 30, 2018
0861979
fix reinterpret error message string (#29844)
KristofferC Oct 30, 2018
f0badf9
Reduce allocation in flatten (#29786)
mschauer Oct 31, 2018
facd000
Use `require(pkgid, ...)` instead of relative require (#29770)
vchuravy Oct 31, 2018
52c67fa
Reinstate statically computed log event ids (#29878)
c42f Nov 1, 2018
8ae1d48
Fix isvalid for 3-byte overlong encoded UTF-8 sequences
ScottPJones Sep 21, 2018
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
2 changes: 1 addition & 1 deletion Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ ifeq ($(OS), FreeBSD)
RPATH += -Wl,-rpath,'$$ORIGIN/$(build_private_libdir_rel)'
endif
RPATH_ORIGIN := -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
RPATH_ESCAPED_ORIGIN := -Wl,-rpath,'\$$\$$ORIGIN' -Wl,-z,origin
RPATH_ESCAPED_ORIGIN := -Wl,-rpath,'\$$\$$ORIGIN' -Wl,-z,origin -Wl,-rpath-link,$(build_shlibdir)
RPATH_LIB := -Wl,-rpath,'$$ORIGIN/julia' -Wl,-rpath,'$$ORIGIN' -Wl,-z,origin
endif

Expand Down
18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ all: debug release
# sort is used to remove potential duplicates
DIRS := $(sort $(build_bindir) $(build_depsbindir) $(build_libdir) $(build_private_libdir) $(build_libexecdir) $(build_includedir) $(build_includedir)/julia $(build_sysconfdir)/julia $(build_datarootdir)/julia $(build_datarootdir)/julia/stdlib $(build_man1dir))
ifneq ($(BUILDROOT),$(JULIAHOME))
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps test test/embedding)
BUILDDIRS := $(BUILDROOT) $(addprefix $(BUILDROOT)/,base src ui doc deps stdlib test test/embedding)
BUILDDIRMAKE := $(addsuffix /Makefile,$(BUILDDIRS))
DIRS := $(DIRS) $(BUILDDIRS)
$(BUILDDIRMAKE): | $(BUILDDIRS)
Expand Down Expand Up @@ -39,9 +39,6 @@ endif
$(foreach dir,$(DIRS),$(eval $(call dir_target,$(dir))))
$(foreach link,base $(JULIAHOME)/test,$(eval $(call symlink_target,$(link),$(build_datarootdir)/julia,$(notdir $(link)))))

build_defaultpkgdir = $(build_datarootdir)/julia/stdlib/$(shell echo $(VERSDIR))
$(eval $(call symlink_target,$(JULIAHOME)/stdlib,$(build_datarootdir)/julia/stdlib,$(shell echo $(VERSDIR))))

julia_flisp.boot.inc.phony: julia-deps
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/src julia_flisp.boot.inc.phony

Expand All @@ -56,9 +53,12 @@ ifndef JULIA_VAGRANT_BUILD
endif
endif

julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test $(build_defaultpkgdir)
julia-deps: | $(DIRS) $(build_datarootdir)/julia/base $(build_datarootdir)/julia/test
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/deps

julia-stdlib: | $(DIRS)
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/stdlib

julia-base: julia-deps $(build_sysconfdir)/julia/startup.jl $(build_man1dir)/julia.1 $(build_datarootdir)/julia/julia-config.jl
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT)/base

Expand All @@ -74,10 +74,10 @@ julia-ui-release julia-ui-debug : julia-ui-% : julia-src-%
julia-sysimg : julia-base julia-ui-$(JULIA_BUILD_MODE)
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys.ji JULIA_EXECUTABLE='$(JULIA_EXECUTABLE)'

julia-sysimg-release : julia-sysimg julia-ui-release
julia-sysimg-release : julia-stdlib julia-sysimg julia-ui-release
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys.$(SHLIB_EXT)

julia-sysimg-debug : julia-sysimg julia-ui-debug
julia-sysimg-debug : julia-stdlib julia-sysimg julia-ui-debug
@$(MAKE) $(QUIET_MAKE) -C $(BUILDROOT) $(build_private_libdir)/sys-debug.$(SHLIB_EXT)

julia-debug julia-release : julia-% : julia-ui-% julia-sysimg-% julia-symlink julia-libccalltest julia-base-cache
Expand Down Expand Up @@ -529,10 +529,11 @@ source-dist:
full-source-dist: light-source-dist.tmp
# Get all the dependencies downloaded
@$(MAKE) -C deps getall NO_GIT=1
@$(MAKE) -C stdlib getall

# Create file full-source-dist.tmp to hold all the filenames that go into the tarball
cp light-source-dist.tmp full-source-dist.tmp
-ls deps/srccache/*.tar.gz deps/srccache/*.tar.bz2 deps/srccache/*.tar.xz deps/srccache/*.tgz deps/srccache/*.zip deps/srccache/*.pem >> full-source-dist.tmp
-ls deps/srccache/*.tar.gz deps/srccache/*.tar.bz2 deps/srccache/*.tar.xz deps/srccache/*.tgz deps/srccache/*.zip deps/srccache/*.pem stdlib/srccache/*.tar.gz >> full-source-dist.tmp

# Prefix everything with the current directory name (usually "julia"), then create tarball
DIRNAME=$$(basename $$(pwd)); \
Expand All @@ -545,6 +546,7 @@ clean: | $(CLEAN_TARGETS)
@-$(MAKE) -C $(BUILDROOT)/src clean
@-$(MAKE) -C $(BUILDROOT)/ui clean
@-$(MAKE) -C $(BUILDROOT)/test clean
@-$(MAKE) -C $(BUILDROOT)/stdlib clean-pkg
-rm -f $(BUILDROOT)/julia
-rm -f $(BUILDROOT)/*.tar.gz
-rm -f $(build_depsbindir)/stringreplace \
Expand Down
6 changes: 3 additions & 3 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2043,11 +2043,11 @@ collection. `destination` must be at least as large as the first collection.

# Examples
```jldoctest
julia> x = zeros(3);
julia> a = zeros(3);

julia> map!(x -> x * 2, x, [1, 2, 3]);
julia> map!(x -> x * 2, a, [1, 2, 3]);

julia> x
julia> a
3-element Array{Float64,1}:
2.0
4.0
Expand Down
1 change: 1 addition & 0 deletions base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ IndexStyle(::Type{<:BitArray}) = IndexLinear()
const _msk64 = ~UInt64(0)
@inline _div64(l) = l >> 6
@inline _mod64(l) = l & 63
@inline _blsr(x)= x & (x-1) #zeros the last set bit. Has native instruction on many archs. needed in multidimensional.jl
@inline _msk_end(l::Integer) = _msk64 >>> _mod64(-l)
@inline _msk_end(B::BitArray) = _msk_end(length(B))
num_bit_chunks(n::Int) = _div64(n+63)
Expand Down
6 changes: 5 additions & 1 deletion base/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,11 @@ function exec_options(opts)
# Load Distributed module only if any of the Distributed options have been specified.
distributed_mode = (opts.worker == 1) || (opts.nprocs > 0) || (opts.machine_file != C_NULL)
if distributed_mode
Core.eval(Main, :(using Distributed))
let Distributed = require(PkgId(UUID((0x8ba89e20_285c_5b6f, 0x9357_94700520ee1b)), "Distributed"))
Core.eval(Main, :(const Distributed = $Distributed))
Core.eval(Main, :(using .Distributed))
end

invokelatest(Main.Distributed.process_opts, opts)
end

Expand Down
32 changes: 20 additions & 12 deletions base/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,14 @@ end
# These affect control flow within the function (so may not be removed
# if there is no usage within the function), but don't affect the purity
# of the function as a whole.
function stmt_affects_purity(@nospecialize stmt)
if isa(stmt, GotoIfNot) || isa(stmt, GotoNode) || isa(stmt, ReturnNode)
function stmt_affects_purity(@nospecialize(stmt), ir)
if isa(stmt, GotoNode) || isa(stmt, ReturnNode)
return false
end
if isa(stmt, GotoIfNot)
t = argextype(stmt.cond, ir, ir.spvals)
return !(t ⊑ Bool)
end
if isa(stmt, Expr)
return stmt.head != :simdloop && stmt.head != :enter
end
Expand All @@ -173,7 +177,7 @@ function optimize(opt::OptimizationState, @nospecialize(result))
proven_pure = true
for i in 1:length(ir.stmts)
stmt = ir.stmts[i]
if stmt_affects_purity(stmt) && !stmt_effect_free(stmt, ir.types[i], ir, ir.spvals)
if stmt_affects_purity(stmt, ir) && !stmt_effect_free(stmt, ir.types[i], ir, ir.spvals)
proven_pure = false
break
end
Expand Down Expand Up @@ -230,15 +234,19 @@ function optimize(opt::OptimizationState, @nospecialize(result))
if force_noinline
opt.src.inlineable = false
elseif isa(def, Method)
bonus = 0
if result ⊑ Tuple && !isbitstype(widenconst(result))
bonus = opt.params.inline_tupleret_bonus
end
if opt.src.inlineable
# For functions declared @inline, increase the cost threshold 20x
bonus += opt.params.inline_cost_threshold*19
if opt.src.inlineable && isdispatchtuple(opt.linfo.specTypes)
# obey @inline declaration if a dispatch barrier would not help
else
bonus = 0
if result ⊑ Tuple && !isbitstype(widenconst(result))
bonus = opt.params.inline_tupleret_bonus
end
if opt.src.inlineable
# For functions declared @inline, increase the cost threshold 20x
bonus += opt.params.inline_cost_threshold*19
end
opt.src.inlineable = isinlineable(def, opt, bonus)
end
opt.src.inlineable = isinlineable(def, opt, bonus)
end
nothing
end
Expand Down Expand Up @@ -312,7 +320,7 @@ function statement_cost(ex::Expr, line::Int, src::CodeInfo, spvals::SimpleVector
atyp = argextype(ex.args[3], src, spvals, slottypes)
return isknowntype(atyp) ? 4 : params.inline_nonleaf_penalty
end
fidx = findfirst(x->x===f, T_FFUNC_KEY)
fidx = find_tfunc(f)
if fidx === nothing
# unknown/unhandled builtin or anonymous function
# Use the generic cost of a direct function call
Expand Down
12 changes: 10 additions & 2 deletions base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ const T_IFUNC_COST = Vector{Int}(undef, N_IFUNC)
const T_FFUNC_KEY = Vector{Any}()
const T_FFUNC_VAL = Vector{Tuple{Int, Int, Any}}()
const T_FFUNC_COST = Vector{Int}()
function find_tfunc(@nospecialize f)
for i = 1:length(T_FFUNC_KEY)
if T_FFUNC_KEY[i] === f
return i
end
end
end

const DATATYPE_NAME_FIELDINDEX = fieldindex(DataType, :name)
const DATATYPE_PARAMETERS_FIELDINDEX = fieldindex(DataType, :parameters)
Expand Down Expand Up @@ -221,10 +228,11 @@ function egal_tfunc(@nospecialize(x), @nospecialize(y))
if isa(x, Conditional) && isa(yy, Const)
yy.val === false && return Conditional(x.var, x.elsetype, x.vtype)
yy.val === true && return x
return x
return Const(false)
elseif isa(y, Conditional) && isa(xx, Const)
xx.val === false && return Conditional(y.var, y.elsetype, y.vtype)
xx.val === true && return y
return Const(false)
elseif isa(xx, Const) && isa(yy, Const)
return Const(xx.val === yy.val)
elseif typeintersect(widenconst(xx), widenconst(yy)) === Bottom
Expand Down Expand Up @@ -1151,7 +1159,7 @@ function builtin_tfunction(@nospecialize(f), argtypes::Array{Any,1},
end
tf = T_IFUNC[iidx]
else
fidx = findfirst(x->x===f, T_FFUNC_KEY)
fidx = find_tfunc(f)
if fidx === nothing
# unknown/unhandled builtin function
return Any
Expand Down
8 changes: 7 additions & 1 deletion base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ devnull
"""
Nothing

A type with no fields that is the type [`nothing`](@ref).
A type with no fields that is the type of [`nothing`](@ref).
"""
Nothing

Expand Down Expand Up @@ -1867,13 +1867,19 @@ typeassert
getproperty(value, name::Symbol)

The syntax `a.b` calls `getproperty(a, :b)`.

See also [`propertynames`](@ref Base.propertynames) and
[`setproperty!`](@ref Base.setproperty!).
"""
Base.getproperty

"""
setproperty!(value, name::Symbol, x)

The syntax `a.b = c` calls `setproperty!(a, :b, c)`.

See also [`propertynames`](@ref Base.propertynames) and
[`getproperty`](@ref Base.getproperty).
"""
Base.setproperty!

Expand Down
10 changes: 6 additions & 4 deletions base/floatfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ signbit(x::Float16) = signbit(bitcast(Int16, x))
"""
maxintfloat(T=Float64)

The largest consecutive integer that is exactly represented in the given floating-point type `T`
(which defaults to `Float64`).
The largest consecutive integer-valued floating-point number that is exactly represented in
the given floating-point type `T` (which defaults to `Float64`).

That is, `maxintfloat` returns the smallest positive integer `n` such that `n+1`
is *not* exactly representable in the type `T`.
That is, `maxintfloat` returns the smallest positive integer-valued floating-point number
`n` such that `n+1` is *not* exactly representable in the type `T`.

When an `Integer`-type value is needed, use `Integer(maxintfloat(T))`.
"""
maxintfloat(::Type{Float64}) = 9007199254740992.
maxintfloat(::Type{Float32}) = Float32(16777216.)
Expand Down
1 change: 0 additions & 1 deletion base/generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,3 @@ IteratorEltype(::Type) = HasEltype() # HasEltype is the default
IteratorEltype(::Type{Generator{I,T}}) where {I,T} = EltypeUnknown()

IteratorEltype(::Type{Any}) = EltypeUnknown()
IteratorEltype(::Type{Union{}}) = EltypeUnknown()
2 changes: 1 addition & 1 deletion base/initdefs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const DEFAULT_LOAD_PATH = ["@", "@v#.#", "@stdlib"]
"""
LOAD_PATH

An array of paths for `using` and `import` statements to consdier as project
An array of paths for `using` and `import` statements to consider as project
environments or package directories when loading code. See Code Loading.
"""
const LOAD_PATH = copy(DEFAULT_LOAD_PATH)
Expand Down
24 changes: 16 additions & 8 deletions base/intfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -744,17 +744,25 @@ julia> digits!([2,2,2,2,2,2], 10, base = 2)
```
"""
function digits!(a::AbstractVector{T}, n::Integer; base::Integer = 10) where T<:Integer
base < 0 && isa(n, Unsigned) && return digits!(a, convert(Signed, n), base = base)
2 <= abs(base) || throw(ArgumentError("base must be ≥ 2 or ≤ -2, got $base"))
hastypemax(T) && abs(base) - 1 > typemax(T) &&
throw(ArgumentError("type $T too small for base $base"))
for i in eachindex(a)
if base > 0
a[i] = rem(n, base)
n = div(n, base)
else
a[i] = mod(n, -base)
n = cld(n, base)
isempty(a) && return a

if base > 0
for i in eachindex(a)
n, d = divrem(n, base)
a[i] = d
end
else
# manually peel one loop iteration for type stability
n, d = fldmod(n, -base)
a[firstindex(a)] = d
n = -signed(n)
for i in firstindex(a)+1:lastindex(a)
n, d = fldmod(n, -base)
a[i] = d
n = -n
end
end
return a
Expand Down
13 changes: 11 additions & 2 deletions base/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -873,18 +873,20 @@ julia> collect(Iterators.flatten((1:2, 8:9)))
flatten(itr) = Flatten(itr)

eltype(::Type{Flatten{I}}) where {I} = eltype(eltype(I))
eltype(::Type{Flatten{Tuple{}}}) = eltype(Tuple{})
IteratorEltype(::Type{Flatten{I}}) where {I} = _flatteneltype(I, IteratorEltype(I))
IteratorEltype(::Type{Flatten{Tuple{}}}) = IteratorEltype(Tuple{})
_flatteneltype(I, ::HasEltype) = IteratorEltype(eltype(I))
_flatteneltype(I, et) = EltypeUnknown()

flatten_iteratorsize(::Union{HasShape, HasLength}, ::Type{<:NTuple{N,Any}}) where {N} = HasLength()
flatten_iteratorsize(::Union{HasShape, HasLength}, ::Type{<:Tuple}) = SizeUnknown()
flatten_iteratorsize(::Union{HasShape, HasLength}, ::Type{<:Number}) = HasLength()
flatten_iteratorsize(::Union{HasShape, HasLength}, ::Type{Union{}}) = SizeUnknown()
flatten_iteratorsize(a, b) = SizeUnknown()

_flatten_iteratorsize(sz, ::EltypeUnknown, I) = SizeUnknown()
_flatten_iteratorsize(sz, ::HasEltype, I) = flatten_iteratorsize(sz, eltype(I))
_flatten_iteratorsize(sz, ::HasEltype, ::Type{Tuple{}}) = HasLength()

IteratorSize(::Type{Flatten{I}}) where {I} = _flatten_iteratorsize(IteratorSize(I), IteratorEltype(I), I)

Expand All @@ -895,6 +897,7 @@ flatten_length(f, ::Type{<:Number}) = length(f.it)
flatten_length(f, T) = throw(ArgumentError(
"Iterates of the argument to Flatten are not known to have constant length"))
length(f::Flatten{I}) where {I} = flatten_length(f, eltype(I))
length(f::Flatten{Tuple{}}) = 0

@propagate_inbounds function iterate(f::Flatten, state=())
if state !== ()
Expand All @@ -903,7 +906,13 @@ length(f::Flatten{I}) where {I} = flatten_length(f, eltype(I))
end
x = (state === () ? iterate(f.it) : iterate(f.it, state[1]))
x === nothing && return nothing
iterate(f, (x[2], x[1]))
y = iterate(x[1])
while y === nothing
x = iterate(f.it, x[2])
x === nothing && return nothing
y = iterate(x[1])
end
return y[1], (x[2], x[1], y[2])
end

reverse(f::Flatten) = Flatten(reverse(itr) for itr in reverse(f.it))
Expand Down
3 changes: 3 additions & 0 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,9 @@ end
# and it reconnects the Base.Docs.META
function _include_from_serialized(path::String, depmods::Vector{Any})
sv = ccall(:jl_restore_incremental, Any, (Cstring, Any), path, depmods)
if isa(sv, Exception)
return sv
end
restored = sv[1]
if !isa(restored, Exception)
for M in restored::Vector{Any}
Expand Down
Loading