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 Julia 1.9.0-beta4 #48311

Merged
merged 46 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d9040a5
Fix mistake in docstring of `keys(::RegexMatch)` (#48252)
simsurace Jan 16, 2023
4dc9a10
Avoid dtrace regenerating the header (#48278)
vchuravy Jan 16, 2023
e640e7b
Profile: print profile peek to stderr (#48291)
IanButterworth Jan 17, 2023
5da6d97
NFC followups for #48246 (#48264)
aviatesk Jan 13, 2023
9c99454
fix some issues discovered by JET (#48303)
KristofferC Jan 18, 2023
914ec69
Fix Splat->splat in NEWS.md (#48350)
knuesel Jan 19, 2023
986dc40
run doc/NEWS-update.jl
IanButterworth Jan 23, 2023
f8b78eb
deps: fix broken `p7zip` url (#48176)
t-bltg Jan 8, 2023
957c93f
improve docs for IPython mode (#48314)
KristofferC Jan 17, 2023
dbe520d
fix an erronous type assert (#48327)
KristofferC Jan 18, 2023
7114a8e
add a type assert to `read` on a `Cmd` (#48334)
KristofferC Jan 19, 2023
60dfe2c
allow extensions to be loaded from non top level env (#48352)
KristofferC Jan 19, 2023
d3fbdf1
make `dlopen`ing `libssp` non fatal (#48333)
t-bltg Jan 22, 2023
9a67956
set max_methods = 1 for REPL methods (#48330)
KristofferC Jan 23, 2023
86fc8b6
inlining: make union splitting account for uncovered call (#48455)
aviatesk Jan 30, 2023
9a8599a
add docs for `getglobal` and `setglobal!` (#48409)
simeonschaub Jan 26, 2023
0a1da69
add docs for try-catch-else (#48414)
simeonschaub Jan 26, 2023
90c9839
Store the frontend task object in the REPL struct. (#48400)
maleadt Jan 27, 2023
186f5a5
avoid hang when only threads are starting IO (#48433)
vtjnash Jan 29, 2023
775c97f
Sorting documentation fixups for 1.9 (#48440)
LilithHafner Jan 30, 2023
de89a2c
prevent heap snapshot test to write to julia dir (#48458)
KristofferC Jan 31, 2023
fcd3ca8
Merge pull request #47676 from gbaraldi/gmp-libblas-version
staticfloat Jan 26, 2023
017365c
Fix `apply_type_tfunc` for `Union{T::TypeVar}`
martinholters Jan 23, 2023
085d4a4
Move `libstdc++` path into `LOADER_*_DEP_LIBS`
staticfloat Jan 19, 2023
e80db09
Load special libraries in-order
staticfloat Jan 19, 2023
f5a6860
bump Pkg to latest v1.9
KristofferC Feb 1, 2023
0f0d425
Add !noalias and !alias.scope metadata
topolarity Jan 12, 2023
d04d36f
Derive `!noalias` from `!tbaa` for most loads/stores
topolarity Jan 12, 2023
2440091
Merge pull request #48485 from topolarity/noalias
KristofferC Feb 2, 2023
08aa3f0
bump Pkg to latest v1.9
KristofferC Feb 5, 2023
68cd01c
Avoid unnecessary Docs.META initializations (#48469)
topolarity Feb 1, 2023
30dcbba
Fix `Base.libblas_name`/`Base.liblapack_name`
giordano Jan 27, 2023
b9c655c
Move `libblas_name`/`liblapack_name` to after `Sys` module
giordano Jan 28, 2023
8b00ed3
Add test for use of `Base.libblas_name`
giordano Jan 28, 2023
a7f04b8
[LinearAlgebra] Fix `libblas_name` test
giordano Feb 3, 2023
26b6e81
remove precompile mutation step from staticdata (#48309)
vtjnash Jan 19, 2023
62b70e3
avoid generating native code if only output ji file (#48431)
vtjnash Jan 28, 2023
d1b9ff9
convert algorithms to SCC (#47866)
vtjnash Dec 12, 2022
a83399c
precompile: do not reanimate zombie external methods (#48475)
vtjnash Feb 4, 2023
d4e0f36
Merge pull request #48513 from JuliaLang/jn/extend-once
KristofferC Feb 7, 2023
27c6d97
Protect `cmd_gen` against invalidation (#48557)
timholy Feb 6, 2023
1ef6c96
Change uses of int to size_t in MurmurHash (#48562)
gbaraldi Feb 7, 2023
997ba79
[compiler] Fix effects of supertype abstract interpretation (#48566)
staticfloat Feb 7, 2023
a3b4c3b
add CTRL_R to repl precompile (#48539)
robsmith11 Feb 5, 2023
c15f520
Add path tracking options from #44359 to docs (#48527)
philbit Feb 5, 2023
d4a4629
give a hint towards `Base.retry_load_extensions` when an extension fa…
KristofferC Feb 7, 2023
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
61 changes: 55 additions & 6 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ JULIA_SYSIMG_release := $(build_private_libdir)/sys.$(SHLIB_EXT)
JULIA_SYSIMG := $(JULIA_SYSIMG_$(JULIA_BUILD_MODE))

define dep_lib_path
$$($(PYTHON) $(call python_cygpath,$(JULIAHOME)/contrib/relative_path.py) $(1) $(2))
$(shell $(PYTHON) $(call python_cygpath,$(JULIAHOME)/contrib/relative_path.py) $(1) $(2))
endef

LIBJULIAINTERNAL_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/libjulia-internal.$(JL_MAJOR_SHLIB_EXT))
Expand Down Expand Up @@ -1526,6 +1526,19 @@ LIBGCC_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/$(L
endif
LIBGCC_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBGCC_NAME))

# We only bother to define this on Linux, as that's the only platform that does libstdc++ probing
# On all other platforms, the LIBSTDCXX_*_DEPLIB variables will be empty.
ifeq ($(OS),Linux)
LIBSTDCXX_NAME := libstdc++.so.6
ifeq ($(USE_SYSTEM_CSL),1)
LIBSTDCXX_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_private_shlibdir)/$(LIBSTDCXX_NAME))
else
LIBSTDCXX_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_shlibdir)/$(LIBSTDCXX_NAME))
endif
LIBSTDCXX_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBSTDCXX_NAME))
endif


# USE_SYSTEM_LIBM and USE_SYSTEM_OPENLIBM causes it to get symlinked into build_private_shlibdir
ifeq ($(USE_SYSTEM_LIBM),1)
LIBM_BUILD_DEPLIB := $(call dep_lib_path,$(build_libdir),$(build_private_shlibdir)/$(LIBMNAME).$(SHLIB_EXT))
Expand All @@ -1539,6 +1552,8 @@ LIBM_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBMN
# We list:
# * libgcc_s, because FreeBSD needs to load ours, not the system one.
# * libopenlibm, because Windows has an untrustworthy libm, and we want to use ours more than theirs
# * libstdc++, because while performing `libstdc++` probing we need to
# know the path to the bundled `libstdc++` library.
# * libjulia-internal, which must always come second-to-last.
# * libjulia-codegen, which must always come last
#
Expand All @@ -1547,11 +1562,45 @@ LIBM_INSTALL_DEPLIB := $(call dep_lib_path,$(libdir),$(private_shlibdir)/$(LIBMN
# * install time relative paths are not equal to build time relative paths (../lib vs. ../lib/julia)
# That second point will no longer be true for most deps once they are placed within Artifacts directories.
# Note that we prefix `libjulia-codegen` and `libjulia-internal` with `@` to signify to the loader that it
# should not automatically dlopen() it in its loading loop.
LOADER_BUILD_DEP_LIBS = $(LIBGCC_BUILD_DEPLIB):$(LIBM_BUILD_DEPLIB):@$(LIBJULIAINTERNAL_BUILD_DEPLIB):@$(LIBJULIACODEGEN_BUILD_DEPLIB):
LOADER_DEBUG_BUILD_DEP_LIBS = $(LIBGCC_BUILD_DEPLIB):$(LIBM_BUILD_DEPLIB):@$(LIBJULIAINTERNAL_DEBUG_BUILD_DEPLIB):@$(LIBJULIACODEGEN_DEBUG_BUILD_DEPLIB):
LOADER_INSTALL_DEP_LIBS = $(LIBGCC_INSTALL_DEPLIB):$(LIBM_INSTALL_DEPLIB):@$(LIBJULIAINTERNAL_INSTALL_DEPLIB):@$(LIBJULIACODEGEN_INSTALL_DEPLIB):
LOADER_DEBUG_INSTALL_DEP_LIBS = $(LIBGCC_INSTALL_DEPLIB):$(LIBM_INSTALL_DEPLIB):@$(LIBJULIAINTERNAL_DEBUG_INSTALL_DEPLIB):@$(LIBJULIACODEGEN_DEBUG_INSTALL_DEPLIB):
# should not automatically dlopen() it in its loading loop, it is "special" and should happen later.
# We do the same for `libstdc++`, and explicitly place it _after_ `libgcc_s`, and `libm` since `libstdc++`
# may depend on those libraries (e.g. when USE_SYSTEM_LIBM=1)

# Helper function to join a list with colons, then place an extra at the end.
define build_deplibs
$(subst $(SPACE),:,$(strip $(1))):
endef

LOADER_BUILD_DEP_LIBS = $(call build_deplibs, \
$(LIBGCC_BUILD_DEPLIB) \
$(LIBM_BUILD_DEPLIB) \
@$(LIBSTDCXX_BUILD_DEPLIB) \
@$(LIBJULIAINTERNAL_BUILD_DEPLIB) \
@$(LIBJULIACODEGEN_BUILD_DEPLIB) \
)

LOADER_DEBUG_BUILD_DEP_LIBS = $(call build_deplibs, \
$(LIBGCC_BUILD_DEPLIB) \
$(LIBM_BUILD_DEPLIB) \
@$(LIBSTDCXX_BUILD_DEPLIB) \
@$(LIBJULIAINTERNAL_DEBUG_BUILD_DEPLIB) \
@$(LIBJULIACODEGEN_DEBUG_BUILD_DEPLIB) \
)

LOADER_INSTALL_DEP_LIBS = $(call build_deplibs, \
$(LIBGCC_INSTALL_DEPLIB) \
$(LIBM_INSTALL_DEPLIB) \
@$(LIBSTDCXX_INSTALL_DEPLIB) \
@$(LIBJULIAINTERNAL_INSTALL_DEPLIB) \
@$(LIBJULIACODEGEN_INSTALL_DEPLIB) \
)
LOADER_DEBUG_INSTALL_DEP_LIBS = $(call build_deplibs, \
$(LIBGCC_INSTALL_DEPLIB) \
$(LIBM_INSTALL_DEPLIB) \
@$(LIBSTDCXX_INSTALL_DEPLIB) \
@$(LIBJULIAINTERNAL_DEBUG_INSTALL_DEPLIB) \
@$(LIBJULIACODEGEN_DEBUG_INSTALL_DEPLIB) \
)

# Colors for make
ifndef VERBOSE
Expand Down
6 changes: 0 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,6 @@ ifeq ($(OS), Linux)
-$(PATCHELF) --set-rpath '$$ORIGIN' $(DESTDIR)$(private_shlibdir)/libLLVM.$(SHLIB_EXT)
endif

# Replace libstdc++ path, which is also moving from `lib` to `../lib/julia`.
ifeq ($(OS),Linux)
$(call stringreplace,$(DESTDIR)$(shlibdir)/libjulia.$(JL_MAJOR_MINOR_SHLIB_EXT),\*libstdc++\.so\.6$$,*$(call dep_lib_path,$(shlibdir),$(private_shlibdir)/libstdc++.so.6))
endif


ifneq ($(LOADER_BUILD_DEP_LIBS),$(LOADER_INSTALL_DEP_LIBS))
# Next, overwrite relative path to libjulia-internal in our loader if $$(LOADER_BUILD_DEP_LIBS) != $$(LOADER_INSTALL_DEP_LIBS)
ifeq ($(JULIA_BUILD_MODE),release)
Expand Down
8 changes: 5 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ New library functions
---------------------

* New function `Iterators.flatmap` ([#44792]).
* New helper `Splat(f)` which acts like `x -> f(x...)`, with pretty printing for
inspecting which function `f` was originally wrapped ([#42717]).
* New `pkgversion(m::Module)` function to get the version of the package that loaded
a given module, similar to `pkgdir(m::Module)` ([#45607]).
* New function `stack(x)` which generalises `reduce(hcat, x::Vector{<:Vector})` to any dimensionality,
Expand Down Expand Up @@ -98,6 +96,8 @@ Standard library changes
* `@kwdef` is now exported and added to the public API ([#46273]).
* An issue with order of operations in `fld1` is now fixed ([#28973]).
* Sorting is now always stable by default, as `QuickSort` was stabilized ([#45222]).
* `Base.splat` is now exported. The return value is now a `Base.Splat` instead
of an anonymous function, which allows for pretty printing ([#42717]).

#### Package Manager

Expand Down Expand Up @@ -185,7 +185,6 @@ Standard library changes
Deprecated or removed
---------------------

* Unexported `splat` is deprecated in favor of exported `Splat`, which has pretty printing of the wrapped function ([#42717]).

External dependencies
---------------------
Expand Down Expand Up @@ -219,6 +218,7 @@ Tooling Improvements
[#44358]: https://github.com/JuliaLang/julia/issues/44358
[#44360]: https://github.com/JuliaLang/julia/issues/44360
[#44512]: https://github.com/JuliaLang/julia/issues/44512
[#44527]: https://github.com/JuliaLang/julia/issues/44527
[#44534]: https://github.com/JuliaLang/julia/issues/44534
[#44571]: https://github.com/JuliaLang/julia/issues/44571
[#44714]: https://github.com/JuliaLang/julia/issues/44714
Expand Down Expand Up @@ -248,5 +248,7 @@ Tooling Improvements
[#46609]: https://github.com/JuliaLang/julia/issues/46609
[#46862]: https://github.com/JuliaLang/julia/issues/46862
[#46976]: https://github.com/JuliaLang/julia/issues/46976
[#47117]: https://github.com/JuliaLang/julia/issues/47117
[#47184]: https://github.com/JuliaLang/julia/issues/47184
[#47367]: https://github.com/JuliaLang/julia/issues/47367
[#47392]: https://github.com/JuliaLang/julia/issues/47392
9 changes: 5 additions & 4 deletions base/Base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,6 @@ end
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "build_h.jl")) # include($BUILDROOT/base/build_h.jl)
include(strcat((length(Core.ARGS)>=2 ? Core.ARGS[2] : ""), "version_git.jl")) # include($BUILDROOT/base/version_git.jl)

# These used to be in build_h.jl and are retained for backwards compatibility
const libblas_name = "libblastrampoline"
const liblapack_name = "libblastrampoline"

# numeric operations
include("hashing.jl")
include("rounding.jl")
Expand Down Expand Up @@ -290,6 +286,11 @@ include("sysinfo.jl")
include("libc.jl")
using .Libc: getpid, gethostname, time

# These used to be in build_h.jl and are retained for backwards compatibility.
# NOTE: keep in sync with `libblastrampoline_jll.libblastrampoline`.
const libblas_name = "libblastrampoline" * (Sys.iswindows() ? "-5" : "")
const liblapack_name = libblas_name

# Logging
include("logging.jl")
using .CoreLogging
Expand Down
2 changes: 1 addition & 1 deletion base/binaryplatforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ function detect_libstdcxx_version(max_minor_version::Int=30)
end

# Brute-force our way through GLIBCXX_* symbols to discover which version we're linked against
hdl = Libdl.dlopen(first(libstdcxx_paths))
hdl = Libdl.dlopen(first(libstdcxx_paths))::Ptr{Cvoid}
# Try all GLIBCXX versions down to GCC v4.8:
# https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
for minor_version in max_minor_version:-1:18
Expand Down
2 changes: 1 addition & 1 deletion base/cmd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function cmd_gen(parsed)
(ignorestatus, flags, env, dir) = (cmd.ignorestatus, cmd.flags, cmd.env, cmd.dir)
append!(args, cmd.exec)
for arg in tail(parsed)
append!(args, arg_gen(arg...)::Vector{String})
append!(args, Base.invokelatest(arg_gen, arg...)::Vector{String})
end
return Cmd(Cmd(args), ignorestatus, flags, env, dir)
else
Expand Down
20 changes: 9 additions & 11 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1890,7 +1890,7 @@ function abstract_call_known(interp::AbstractInterpreter, @nospecialize(f),
fargs = nothing
end
argtypes = Any[typeof(<:), argtypes[3], argtypes[2]]
return CallMeta(abstract_call_known(interp, <:, ArgInfo(fargs, argtypes), si, sv, max_methods).rt, EFFECTS_TOTAL, NoCallInfo())
return abstract_call_known(interp, <:, ArgInfo(fargs, argtypes), si, sv, max_methods)
elseif la == 2 &&
(a2 = argtypes[2]; isa(a2, Const)) && (svecval = a2.val; isa(svecval, SimpleVector)) &&
istopfunction(f, :length)
Expand Down Expand Up @@ -2045,14 +2045,13 @@ function abstract_eval_value_expr(interp::AbstractInterpreter, e::Expr, vtypes::
end
elseif head === :boundscheck
if isa(sv, InferenceState)
flag = sv.src.ssaflags[sv.currpc]
# If there is no particular @inbounds for this function, then we only taint `noinbounds`,
# which will subsequently taint consistency if this function is called from another
# function that uses `@inbounds`. However, if this :boundscheck is itself within an
# If there is no particular `@inbounds` for this function, then we only taint `:noinbounds`,
# which will subsequently taint `:consistent`-cy if this function is called from another
# function that uses `@inbounds`. However, if this `:boundscheck` is itself within an
# `@inbounds` region, its value depends on `--check-bounds`, so we need to taint
# consistency here also.
# `:consistent`-cy here also.
merge_effects!(interp, sv, Effects(EFFECTS_TOTAL; noinbounds=false,
consistent = (flag & IR_FLAG_INBOUNDS) != 0 ? ALWAYS_FALSE : ALWAYS_TRUE))
consistent = (get_curr_ssaflag(sv) & IR_FLAG_INBOUNDS) != 0 ? ALWAYS_FALSE : ALWAYS_TRUE))
end
rt = Bool
elseif head === :inbounds
Expand Down Expand Up @@ -2333,8 +2332,8 @@ function abstract_eval_phi(interp::AbstractInterpreter, phi::PhiNode, vtypes::Un
end

function stmt_taints_inbounds_consistency(sv::InferenceState)
flag = sv.src.ssaflags[sv.currpc]
return sv.src.propagate_inbounds || (flag & IR_FLAG_INBOUNDS) != 0
sv.src.propagate_inbounds && return true
return (get_curr_ssaflag(sv) & IR_FLAG_INBOUNDS) != 0
end

function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e), vtypes::VarTable, sv::InferenceState)
Expand All @@ -2346,13 +2345,12 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
end
(;rt, effects) = abstract_eval_statement_expr(interp, e, vtypes, sv, nothing)
if !effects.noinbounds
flag = sv.src.ssaflags[sv.currpc]
if !sv.src.propagate_inbounds
# The callee read our inbounds flag, but unless we propagate inbounds,
# we ourselves don't read our parent's inbounds.
effects = Effects(effects; noinbounds=true)
end
if (flag & IR_FLAG_INBOUNDS) != 0
if (get_curr_ssaflag(sv) & IR_FLAG_INBOUNDS) != 0
effects = Effects(effects; consistent=ALWAYS_FALSE)
end
end
Expand Down
4 changes: 2 additions & 2 deletions base/compiler/effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ following meanings:
This state corresponds to LLVM's `inaccessiblemem_or_argmemonly` function attribute.
- `nonoverlayed::Bool`: indicates that any methods that may be called within this method
are not defined in an [overlayed method table](@ref OverlayMethodTable).
- `noinbounds::Bool`: If set, indicates that this method does not read the parent's :inbounds
state. In particular, it does not have any reached :boundscheck exprs, not propagates inbounds
- `noinbounds::Bool`: If set, indicates that this method does not read the parent's `:inbounds`
state. In particular, it does not have any reached `:boundscheck` exprs, not propagates inbounds
to any children that do.

Note that the representations above are just internal implementation details and thus likely
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/inferencestate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ mutable struct InferenceState

valid_worlds = WorldRange(src.min_world, src.max_world == typemax(UInt) ? get_world_counter() : src.max_world)
bestguess = Bottom
ipo_effects = Effects(EFFECTS_TOTAL)
ipo_effects = EFFECTS_TOTAL

params = InferenceParams(interp)
restrict_abstract_call_sites = isa(linfo.def, Module)
Expand Down
14 changes: 7 additions & 7 deletions base/compiler/ssair/inlining.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1348,14 +1348,13 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig:
nunion === nothing && return nothing
cases = InliningCase[]
argtypes = sig.argtypes
local any_fully_covered = false
local handled_all_cases::Bool = true
local revisit_idx = nothing
local only_method = nothing
local meth::MethodLookupResult
local all_result_count = 0
local joint_effects::Effects = EFFECTS_TOTAL
local nothrow::Bool = true
local fully_covered::Bool = true
for i = 1:nunion
meth = getsplit(info, i)
if meth.ambig
Expand All @@ -1377,12 +1376,12 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig:
only_method = false
end
end
local split_fully_covered::Bool = false
for (j, match) in enumerate(meth)
all_result_count += 1
result = getresult(info, all_result_count)
joint_effects = merge_effects(joint_effects, info_effects(result, match, state))
nothrow &= match.fully_covers
any_fully_covered |= match.fully_covers
split_fully_covered |= match.fully_covers
if !validate_sparams(match.sparams)
if !match.fully_covers
handled_all_cases = false
Expand All @@ -1399,9 +1398,10 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig:
result, match, argtypes, info, flag, state; allow_abstract=true, allow_typevars=false)
end
end
fully_covered &= split_fully_covered
end

joint_effects = Effects(joint_effects; nothrow)
joint_effects = Effects(joint_effects; nothrow=fully_covered)

if handled_all_cases && revisit_idx !== nothing
# we handled everything except one match with unmatched sparams,
Expand All @@ -1428,13 +1428,13 @@ function compute_inlining_cases(@nospecialize(info::CallInfo), flag::UInt8, sig:
end
handle_any_const_result!(cases,
result, match, argtypes, info, flag, state; allow_abstract=true, allow_typevars=true)
any_fully_covered = handled_all_cases = match.fully_covers
fully_covered = handled_all_cases = match.fully_covers
elseif !handled_all_cases
# if we've not seen all candidates, union split is valid only for dispatch tuples
filter!(case::InliningCase->isdispatchtuple(case.sig), cases)
end

return cases, (handled_all_cases & any_fully_covered), joint_effects
return cases, (handled_all_cases & fully_covered), joint_effects
end

function handle_call!(todo::Vector{Pair{Int,Any}},
Expand Down
2 changes: 1 addition & 1 deletion base/compiler/tfuncs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ function apply_type_tfunc(@nospecialize(headtypetype), @nospecialize args...)
end
end
if largs == 1 # Union{T} --> T
u1 = typeintersect(widenconst(args[1]), Type)
u1 = typeintersect(widenconst(args[1]), Union{Type,TypeVar})
valid_as_lattice(u1) || return Bottom
return u1
end
Expand Down
7 changes: 4 additions & 3 deletions base/docs/Docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ const modules = Module[]
const META = gensym(:meta)
const METAType = IdDict{Any,Any}

function meta(m::Module)
function meta(m::Module; autoinit::Bool=true)
if !isdefined(m, META) || getfield(m, META) === nothing
initmeta(m)
autoinit ? initmeta(m) : return nothing
end
return getfield(m, META)::METAType
end
Expand Down Expand Up @@ -161,7 +161,8 @@ end
function docstr(binding::Binding, typesig = Union{})
@nospecialize typesig
for m in modules
dict = meta(m)
dict = meta(m; autoinit=false)
isnothing(dict) && continue
if haskey(dict, binding)
docs = dict[binding].docs
if haskey(docs, typesig)
Expand Down
Loading