Skip to content

Commit f64aecd

Browse files
committed
go back to 1.6 version of precompile
1 parent 06a31a0 commit f64aecd

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

base/loading.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1926,13 +1926,7 @@ function precompile(@nospecialize(f), args::Tuple)
19261926
precompile(Tuple{Core.Typeof(f), args...})
19271927
end
19281928

1929-
function precompile(argt::Type)
1930-
success = ccall(:jl_compile_hint, Int32, (Any,), argt) != 0
1931-
if !success
1932-
@debug "Inactive precompile statement" maxlog=10 form=argt _module=nothing _file=nothing _line=0
1933-
end
1934-
return success
1935-
end
1929+
precompile(argt::Type) = ccall(:jl_compile_hint, Int32, (Any,), argt) != 0
19361930

19371931
precompile(include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof(_concrete_dependencies), Nothing))
19381932
precompile(include_package_for_output, (PkgId, String, Vector{String}, Vector{String}, Vector{String}, typeof(_concrete_dependencies), String))

test/ambiguous.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ end
6666
## Other ways of accessing functions
6767
# Test that non-ambiguous cases work
6868
let io = IOBuffer()
69-
@test @test_logs precompile(ambig, (Int, Int))
69+
@test precompile(ambig, (Int, Int))
7070
cf = @eval @cfunction(ambig, Int, (Int, Int))
7171
@test ccall(cf, Int, (Int, Int), 1, 2) == 4
7272
@test length(code_lowered(ambig, (Int, Int))) == 1
@@ -75,7 +75,7 @@ end
7575

7676
# Test that ambiguous cases fail appropriately
7777
let io = IOBuffer()
78-
@test @test_logs (:warn,) precompile(ambig, (UInt8, Int))
78+
@test !precompile(ambig, (UInt8, Int))
7979
cf = @eval @cfunction(ambig, Int, (UInt8, Int)) # test for a crash (doesn't throw an error)
8080
@test_throws(MethodError(ambig, (UInt8(1), Int(2)), get_world_counter()),
8181
ccall(cf, Int, (UInt8, Int), 1, 2))

0 commit comments

Comments
 (0)