Skip to content

Commit b30e99c

Browse files
committed
Fix tests - address rebase issues
1 parent ab90932 commit b30e99c

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Compiler/Runtime improvements
5757
* Abstract callsite can now be inlined or statically resolved as far as the callsite has a single
5858
matching method ([#43113]).
5959
* Builtin function are now a bit more like generic functions, and can be enumerated with `methods` ([#43865]).
60-
* Inference now tracks various effects such as sideeffectful-ness and nothrow-ness on a per-specialization basis. Code heavilty dependent on constant propagation should see significant compile-time performance improvements and certain cases (e.g. calls to unlinineable functions that are nevertheless effect free) should see runtime performance improvements. Effects may be overwritten manually with the `@Base.assume_effects` macro. (#43852).
60+
* Inference now tracks various effects such as sideeffectful-ness and nothrow-ness on a per-specialization basis. Code heavily dependent on constant propagation should see significant compile-time performance improvements and certain cases (e.g. calls to uninlinable functions that are nevertheless effect free) should see runtime performance improvements. Effects may be overwritten manually with the `@Base.assume_effects` macro. (#43852).
6161

6262
Command-line option changes
6363
---------------------------

base/compiler/abstractinterpretation.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,25 +1937,25 @@ function abstract_eval_statement(interp::AbstractInterpreter, @nospecialize(e),
19371937
end
19381938

19391939
function abstract_eval_global(M::Module, s::Symbol)
1940-
if isdefined(M,s) && isconst(M,s)
1941-
return Const(getfield(M,s))
1940+
if isdefined(M,s)
1941+
if isconst(M,s)
1942+
return Const(getfield(M,s))
1943+
end
19421944
end
19431945
ty = ccall(:jl_binding_type, Any, (Any, Any), M, s)
19441946
ty === nothing && return Any
19451947
return ty
19461948
end
19471949

19481950
function abstract_eval_global(M::Module, s::Symbol, frame::InferenceState)
1951+
ty = abstract_eval_global(M, s)
1952+
isa(ty, Const) && return ty
19491953
if isdefined(M,s)
1950-
if isconst(M,s)
1951-
return Const(getfield(M,s))
1952-
else
1953-
tristate_merge!(frame, Effects(EFFECTS_TOTAL, consistent=ALWAYS_FALSE))
1954-
end
1954+
tristate_merge!(frame, Effects(EFFECTS_TOTAL, consistent=ALWAYS_FALSE))
19551955
else
19561956
tristate_merge!(frame, Effects(EFFECTS_TOTAL, consistent=ALWAYS_FALSE, nothrow=ALWAYS_FALSE))
19571957
end
1958-
return Any
1958+
return ty
19591959
end
19601960

19611961
abstract_eval_ssavalue(s::SSAValue, sv::InferenceState) = abstract_eval_ssavalue(s, sv.src)

test/abstractarray.jl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ mutable struct TestThrowNoGetindex{T} <: AbstractVector{T} end
529529
@testset "ErrorException if getindex is not defined" begin
530530
Base.length(::TestThrowNoGetindex) = 2
531531
Base.size(::TestThrowNoGetindex) = (2,)
532-
@test_throws ErrorException isassigned(TestThrowNoGetindex{Float64}(), 1)
532+
@test_throws Base.CanonicalIndexError isassigned(TestThrowNoGetindex{Float64}(), 1)
533533
end
534534

535535
function test_in_bounds(::Type{TestAbstractArray})
@@ -565,10 +565,10 @@ end
565565
function test_getindex_internals(::Type{TestAbstractArray})
566566
U = UnimplementedFastArray{Int, 2}()
567567
V = UnimplementedSlowArray{Int, 2}()
568-
@test_throws ErrorException getindex(U, 1)
569-
@test_throws ErrorException Base.unsafe_getindex(U, 1)
570-
@test_throws ErrorException getindex(V, 1, 1)
571-
@test_throws ErrorException Base.unsafe_getindex(V, 1, 1)
568+
@test_throws Base.CanonicalIndexError getindex(U, 1)
569+
@test_throws Base.CanonicalIndexError Base.unsafe_getindex(U, 1)
570+
@test_throws Base.CanonicalIndexError getindex(V, 1, 1)
571+
@test_throws Base.CanonicalIndexError Base.unsafe_getindex(V, 1, 1)
572572
end
573573

574574
function test_setindex!_internals(::Type{T}, shape, ::Type{TestAbstractArray}) where T
@@ -583,10 +583,10 @@ end
583583
function test_setindex!_internals(::Type{TestAbstractArray})
584584
U = UnimplementedFastArray{Int, 2}()
585585
V = UnimplementedSlowArray{Int, 2}()
586-
@test_throws ErrorException setindex!(U, 0, 1)
587-
@test_throws ErrorException Base.unsafe_setindex!(U, 0, 1)
588-
@test_throws ErrorException setindex!(V, 0, 1, 1)
589-
@test_throws ErrorException Base.unsafe_setindex!(V, 0, 1, 1)
586+
@test_throws Base.CanonicalIndexError setindex!(U, 0, 1)
587+
@test_throws Base.CanonicalIndexError Base.unsafe_setindex!(U, 0, 1)
588+
@test_throws Base.CanonicalIndexError setindex!(V, 0, 1, 1)
589+
@test_throws Base.CanonicalIndexError Base.unsafe_setindex!(V, 0, 1, 1)
590590
end
591591

592592
function test_get(::Type{TestAbstractArray})

test/broadcast.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -695,12 +695,12 @@ end
695695
A = [[1,2,3],4:5,6]
696696
A[1] .= 0
697697
@test A[1] == [0,0,0]
698-
@test_throws ErrorException A[2] .= 0
698+
@test_throws Base.CanonicalIndexError A[2] .= 0
699699
@test_throws MethodError A[3] .= 0
700700
A = [[1,2,3],4:5]
701701
A[1] .= 0
702702
@test A[1] == [0,0,0]
703-
@test_throws ErrorException A[2] .= 0
703+
@test_throws Base.CanonicalIndexError A[2] .= 0
704704
end
705705

706706
# Issue #22180

test/read.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ end
604604
read!(io, @view y[4:7])
605605
@test y[4:7] == v
606606
seekstart(io)
607-
@test_throws ErrorException read!(io, @view z[4:6])
607+
@test_throws Base.CanonicalIndexError read!(io, @view z[4:6])
608608
end
609609

610610
# Bulk read from pipe

test/strings/basic.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,7 +1039,7 @@ let s = "∀x∃y", u = codeunits(s)
10391039
@test u[1] == 0xe2
10401040
@test u[2] == 0x88
10411041
@test u[8] == 0x79
1042-
@test_throws ErrorException (u[1] = 0x00)
1042+
@test_throws Base.CanonicalIndexError (u[1] = 0x00)
10431043
@test collect(u) == b"∀x∃y"
10441044
@test Base.elsize(u) == Base.elsize(typeof(u)) == 1
10451045
end
@@ -1100,4 +1100,4 @@ end
11001100
let d = Dict(lazy"$(1+2) is 3" => 3)
11011101
@test d["3 is 3"] == 3
11021102
end
1103-
end
1103+
end

test/strings/util.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ let testb() = b"0123"
629629
b = testb()
630630
@test eltype(b) === UInt8
631631
@test b isa AbstractVector
632-
@test_throws ErrorException b[4] = '4'
632+
@test_throws Base.CanonicalIndexError b[4] = '4'
633633
@test testb() == UInt8['0','1','2','3']
634634
end
635635

0 commit comments

Comments
 (0)