Skip to content

Commit cb39d4c

Browse files
committed
remove more unneeded pure annotations
1 parent a14b9d3 commit cb39d4c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

base/linalg/uniformscaling.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
import Base: copy, ctranspose, getindex, show, transpose, one, zero, inv,
4-
@_pure_meta, hcat, vcat, hvcat
4+
hcat, vcat, hvcat
55
import Base.LinAlg: SingularException
66

77
struct UniformScaling{T<:Number}
@@ -201,7 +201,7 @@ promote_to_arrays(n,k, ::Type{T}, A, B, C) where {T} =
201201
(promote_to_arrays_(n[k], T, A), promote_to_arrays_(n[k+1], T, B), promote_to_arrays_(n[k+2], T, C))
202202
promote_to_arrays(n,k, ::Type{T}, A, B, Cs...) where {T} =
203203
(promote_to_arrays_(n[k], T, A), promote_to_arrays_(n[k+1], T, B), promote_to_arrays(n,k+2, T, Cs...)...)
204-
promote_to_array_type(A::Tuple{Vararg{Union{AbstractVecOrMat,UniformScaling}}}) = (@_pure_meta; Matrix)
204+
promote_to_array_type(A::Tuple{Vararg{Union{AbstractVecOrMat,UniformScaling}}}) = Matrix
205205

206206
for (f,dim,name) in ((:hcat,1,"rows"), (:vcat,2,"cols"))
207207
@eval begin

base/promotion.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ end
122122

123123
## promotion mechanism ##
124124

125-
promote_type() = (@_pure_meta; Bottom)
125+
promote_type() = Bottom
126126
promote_type(T) = T
127127
promote_type(T, S, U, V...) = (@_inline_meta; promote_type(T, promote_type(S, U, V...)))
128128

129-
promote_type(::Type{Bottom}, ::Type{Bottom}) = (@_pure_meta; Bottom)
129+
promote_type(::Type{Bottom}, ::Type{Bottom}) = Bottom
130130
promote_type(::Type{T}, ::Type{T}) where {T} = T
131131
promote_type(::Type{T}, ::Type{Bottom}) where {T} = T
132132
promote_type(::Type{Bottom}, ::Type{T}) where {T} = T
@@ -162,7 +162,7 @@ function promote_type(::Type{T}, ::Type{S}) where {T,S}
162162
end
163163

164164
# TODO: this is not hyperpure, but the pure anotation seems necessary for inference to work
165-
promote_rule(::Type{<:Any}, ::Type{<:Any}) = (@_pure_meta; Bottom)
165+
promote_rule(::Type{<:Any}, ::Type{<:Any}) = Bottom
166166

167167
promote_result(::Type{<:Any},::Type{<:Any},::Type{T},::Type{S}) where {T,S} = (@_inline_meta; promote_type(T,S))
168168
# If no promote_rule is defined, both directions give Bottom. In that

base/sparse/abstractsparse.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ issparse(S::LinAlg.UnitLowerTriangular{<:Any,<:AbstractSparseMatrix}) = true
2020
issparse(S::UpperTriangular{<:Any,<:AbstractSparseMatrix}) = true
2121
issparse(S::LinAlg.UnitUpperTriangular{<:Any,<:AbstractSparseMatrix}) = true
2222

23-
indtype(S::AbstractSparseArray{<:Any,Ti}) where {Ti} = (Base.@_pure_meta; Ti)
23+
indtype(S::AbstractSparseArray{<:Any,Ti}) where {Ti} = Ti

base/sparse/sparsevector.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
### Common definitions
44

5-
import Base: scalarmax, scalarmin, sort, find, findnz, @_pure_meta
5+
import Base: scalarmax, scalarmin, sort, find, findnz
66
import Base.LinAlg: promote_to_array_type, promote_to_arrays_
77

88
### The SparseVector
@@ -962,8 +962,8 @@ function hvcat(rows::Tuple{Vararg{Int}}, X::_SparseConcatGroup...)
962962
end
963963

964964
# make sure UniformScaling objects are converted to sparse matrices for concatenation
965-
promote_to_array_type(A::Tuple{Vararg{Union{_SparseConcatGroup,UniformScaling}}}) = (@_pure_meta; SparseMatrixCSC)
966-
promote_to_array_type(A::Tuple{Vararg{Union{_DenseConcatGroup,UniformScaling}}}) = (@_pure_meta; Matrix)
965+
promote_to_array_type(A::Tuple{Vararg{Union{_SparseConcatGroup,UniformScaling}}}) = SparseMatrixCSC
966+
promote_to_array_type(A::Tuple{Vararg{Union{_DenseConcatGroup,UniformScaling}}}) = Matrix
967967
promote_to_arrays_(n::Int, ::Type{SparseMatrixCSC}, J::UniformScaling) = sparse(J, n, n)
968968

969969
# Concatenations strictly involving un/annotated dense matrices/vectors should yield dense arrays

0 commit comments

Comments
 (0)