Skip to content

Commit 9eb367a

Browse files
committed
Also rename the bootstrap version
1 parent af7d34f commit 9eb367a

File tree

7 files changed

+35
-35
lines changed

7 files changed

+35
-35
lines changed

base/bool.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ julia> .![true false true]
3232
"""
3333
function !(x::Bool)
3434
## We need a better heuristic to detect this automatically
35-
@_pure_meta
35+
@_unsafe_pure_meta
3636
return not_int(x)
3737
end
3838

base/essentials.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ macro nospecialize(var, vars...)
6161
Expr(:meta, :nospecialize, var, vars...)
6262
end
6363

64-
macro _pure_meta()
64+
macro _unsafe_pure_meta()
6565
Expr(:meta, :pure)
6666
end
6767
# another version of inlining that propagates an inbounds context
@@ -143,24 +143,24 @@ tail(x::Tuple) = argtail(x...)
143143

144144
# TODO: a better / more infer-able definition would pehaps be
145145
# tuple_type_head(T::Type) = fieldtype(T::Type{<:Tuple}, 1)
146-
tuple_type_head(T::UnionAll) = (@_pure_meta; UnionAll(T.var, tuple_type_head(T.body)))
146+
tuple_type_head(T::UnionAll) = (@_unsafe_pure_meta; UnionAll(T.var, tuple_type_head(T.body)))
147147
function tuple_type_head(T::Union)
148-
@_pure_meta
148+
@_unsafe_pure_meta
149149
return Union{tuple_type_head(T.a), tuple_type_head(T.b)}
150150
end
151151
function tuple_type_head(T::DataType)
152-
@_pure_meta
152+
@_unsafe_pure_meta
153153
T.name === Tuple.name || throw(MethodError(tuple_type_head, (T,)))
154154
return unwrapva(T.parameters[1])
155155
end
156156

157-
tuple_type_tail(T::UnionAll) = (@_pure_meta; UnionAll(T.var, tuple_type_tail(T.body)))
157+
tuple_type_tail(T::UnionAll) = (@_unsafe_pure_meta; UnionAll(T.var, tuple_type_tail(T.body)))
158158
function tuple_type_tail(T::Union)
159-
@_pure_meta
159+
@_unsafe_pure_meta
160160
return Union{tuple_type_tail(T.a), tuple_type_tail(T.b)}
161161
end
162162
function tuple_type_tail(T::DataType)
163-
@_pure_meta
163+
@_unsafe_pure_meta
164164
T.name === Tuple.name || throw(MethodError(tuple_type_tail, (T,)))
165165
if isvatuple(T) && length(T.parameters) == 1
166166
return T
@@ -170,7 +170,7 @@ end
170170

171171
tuple_type_cons(::Type, ::Type{Union{}}) = Union{}
172172
function tuple_type_cons(::Type{S}, ::Type{T}) where T<:Tuple where S
173-
@_pure_meta
173+
@_unsafe_pure_meta
174174
Tuple{S, T.parameters...}
175175
end
176176

base/operators.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ Signed
4141
```
4242
"""
4343
function supertype(T::DataType)
44-
@_pure_meta
44+
@_unsafe_pure_meta
4545
T.super
4646
end
4747

4848
function supertype(T::UnionAll)
49-
@_pure_meta
49+
@_unsafe_pure_meta
5050
UnionAll(T.var, supertype(T.body))
5151
end
5252

@@ -151,11 +151,11 @@ isless(x::AbstractFloat, y::Real ) = (!isnan(x) & (isnan(y) | signless(x
151151

152152

153153
function ==(T::Type, S::Type)
154-
@_pure_meta
154+
@_unsafe_pure_meta
155155
T<:S && S<:T
156156
end
157157
function !=(T::Type, S::Type)
158-
@_pure_meta
158+
@_unsafe_pure_meta
159159
!(T == S)
160160
end
161161
==(T::TypeVar, S::Type) = false

base/promotion.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
Return the closest common ancestor of `T` and `S`, i.e. the narrowest type from which
1010
they both inherit.
1111
"""
12-
typejoin() = (@_pure_meta; Bottom)
13-
typejoin(@nospecialize(t)) = (@_pure_meta; t)
14-
typejoin(@nospecialize(t), ts...) = (@_pure_meta; typejoin(t, typejoin(ts...)))
12+
typejoin() = (@_unsafe_pure_meta; Bottom)
13+
typejoin(@nospecialize(t)) = (@_unsafe_pure_meta; t)
14+
typejoin(@nospecialize(t), ts...) = (@_unsafe_pure_meta; typejoin(t, typejoin(ts...)))
1515
function typejoin(@nospecialize(a), @nospecialize(b))
16-
@_pure_meta
16+
@_unsafe_pure_meta
1717
if a <: b
1818
return b
1919
elseif b <: a

base/reflection.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ Memory allocation minimum alignment for instances of this type.
256256
Can be called on any `isconcretetype`.
257257
"""
258258
function datatype_alignment(dt::DataType)
259-
@_pure_meta
259+
@_unsafe_pure_meta
260260
dt.layout == C_NULL && throw(UndefRefError())
261261
alignment = unsafe_load(convert(Ptr{DataTypeLayout}, dt.layout)).alignment
262262
return Int(alignment & 0x1FF)
@@ -270,7 +270,7 @@ with no intervening padding bytes.
270270
Can be called on any `isconcretetype`.
271271
"""
272272
function datatype_haspadding(dt::DataType)
273-
@_pure_meta
273+
@_unsafe_pure_meta
274274
dt.layout == C_NULL && throw(UndefRefError())
275275
alignment = unsafe_load(convert(Ptr{DataTypeLayout}, dt.layout)).alignment
276276
return (alignment >> 9) & 1 == 1
@@ -283,7 +283,7 @@ Return whether instances of this type can contain references to gc-managed memor
283283
Can be called on any `isconcretetype`.
284284
"""
285285
function datatype_pointerfree(dt::DataType)
286-
@_pure_meta
286+
@_unsafe_pure_meta
287287
dt.layout == C_NULL && throw(UndefRefError())
288288
alignment = unsafe_load(convert(Ptr{DataTypeLayout}, dt.layout)).alignment
289289
return (alignment >> 10) & 0xFFFFF == 0
@@ -299,7 +299,7 @@ Can be called on any `isconcretetype`.
299299
See also [`Base.fieldoffset`](@ref).
300300
"""
301301
function datatype_fielddesc_type(dt::DataType)
302-
@_pure_meta
302+
@_unsafe_pure_meta
303303
dt.layout == C_NULL && throw(UndefRefError())
304304
alignment = unsafe_load(convert(Ptr{DataTypeLayout}, dt.layout)).alignment
305305
return (alignment >> 30) & 3
@@ -321,7 +321,7 @@ julia> isimmutable([1,2])
321321
false
322322
```
323323
"""
324-
isimmutable(@nospecialize(x)) = (@_pure_meta; !typeof(x).mutable)
324+
isimmutable(@nospecialize(x)) = (@_unsafe_pure_meta; !typeof(x).mutable)
325325

326326
"""
327327
Base.isstructtype(T) -> Bool
@@ -330,7 +330,7 @@ Determine whether type `T` was declared as a struct type
330330
(i.e. using the `struct` or `mutable struct` keyword).
331331
"""
332332
function isstructtype(@nospecialize(t::Type))
333-
@_pure_meta
333+
@_unsafe_pure_meta
334334
t = unwrap_unionall(t)
335335
# TODO: what to do for `Union`?
336336
isa(t, DataType) || return false
@@ -344,7 +344,7 @@ Determine whether type `T` was declared as a primitive type
344344
(i.e. using the `primitive` keyword).
345345
"""
346346
function isprimitivetype(@nospecialize(t::Type))
347-
@_pure_meta
347+
@_unsafe_pure_meta
348348
t = unwrap_unionall(t)
349349
# TODO: what to do for `Union`?
350350
isa(t, DataType) || return false
@@ -372,14 +372,14 @@ julia> isbitstype(Complex)
372372
false
373373
```
374374
"""
375-
isbitstype(@nospecialize(t::Type)) = (@_pure_meta; isa(t, DataType) && t.isbitstype)
375+
isbitstype(@nospecialize(t::Type)) = (@_unsafe_pure_meta; isa(t, DataType) && t.isbitstype)
376376

377377
"""
378378
isbits(x)
379379
380380
Return `true` if `x` is an instance of an `isbitstype` type.
381381
"""
382-
isbits(@nospecialize x) = (@_pure_meta; typeof(x).isbitstype)
382+
isbits(@nospecialize x) = (@_unsafe_pure_meta; typeof(x).isbitstype)
383383

384384
"""
385385
isdispatchtuple(T)
@@ -388,7 +388,7 @@ Determine whether type `T` is a tuple "leaf type",
388388
meaning it could appear as a type signature in dispatch
389389
and has no subtypes (or supertypes) which could appear in a call.
390390
"""
391-
isdispatchtuple(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.isdispatchtuple)
391+
isdispatchtuple(@nospecialize(t)) = (@_unsafe_pure_meta; isa(t, DataType) && t.isdispatchtuple)
392392

393393
"""
394394
isconcretetype(T)
@@ -417,7 +417,7 @@ julia> isconcretetype(Union{Int,String})
417417
false
418418
```
419419
"""
420-
isconcretetype(@nospecialize(t)) = (@_pure_meta; isa(t, DataType) && t.isconcretetype)
420+
isconcretetype(@nospecialize(t)) = (@_unsafe_pure_meta; isa(t, DataType) && t.isconcretetype)
421421

422422
"""
423423
Base.isabstracttype(T)
@@ -435,7 +435,7 @@ false
435435
```
436436
"""
437437
function isabstracttype(@nospecialize(t))
438-
@_pure_meta
438+
@_unsafe_pure_meta
439439
t = unwrap_unionall(t)
440440
# TODO: what to do for `Union`?
441441
return isa(t, DataType) && t.abstract
@@ -462,7 +462,7 @@ Any
462462
```
463463
"""
464464
function parameter_upper_bound(t::UnionAll, idx)
465-
@_pure_meta
465+
@_unsafe_pure_meta
466466
return rewrap_unionall((unwrap_unionall(t)::DataType).parameters[idx], t)
467467
end
468468

@@ -472,7 +472,7 @@ end
472472
Compute a type that contains the intersection of `T` and `S`. Usually this will be the
473473
smallest such type or one close to it.
474474
"""
475-
typeintersect(@nospecialize(a),@nospecialize(b)) = (@_pure_meta; ccall(:jl_type_intersection, Any, (Any,Any), a, b))
475+
typeintersect(@nospecialize(a),@nospecialize(b)) = (@_unsafe_pure_meta; ccall(:jl_type_intersection, Any, (Any,Any), a, b))
476476

477477
"""
478478
fieldoffset(type, i)
@@ -499,7 +499,7 @@ julia> structinfo(Base.Filesystem.StatStruct)
499499
(0x0000000000000058, :ctime, Float64)
500500
```
501501
"""
502-
fieldoffset(x::DataType, idx::Integer) = (@_pure_meta; ccall(:jl_get_field_offset, Csize_t, (Any, Cint), x, idx))
502+
fieldoffset(x::DataType, idx::Integer) = (@_unsafe_pure_meta; ccall(:jl_get_field_offset, Csize_t, (Any, Cint), x, idx))
503503

504504
"""
505505
fieldtype(T, name::Symbol | index::Int)
@@ -611,7 +611,7 @@ julia> instances(Color)
611611
function instances end
612612

613613
function to_tuple_type(@nospecialize(t))
614-
@_pure_meta
614+
@_unsafe_pure_meta
615615
if isa(t,Tuple) || isa(t,AbstractArray) || isa(t,SimpleVector)
616616
t = Tuple{t...}
617617
end

base/tuple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function eltype(t::Type{<:Tuple{Vararg{E}}}) where {E}
8686
end
8787
eltype(t::Type{<:Tuple}) = _compute_eltype(t)
8888
function _compute_eltype(t::Type{<:Tuple})
89-
@_pure_meta
89+
@_unsafe_pure_meta
9090
t isa Union && return promote_typejoin(eltype(t.a), eltype(t.b))
9191
= unwrap_unionall(t)
9292
r = Union{}

test/dimensionful.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Furlong{p}(v::Number) where {p} = Furlong{p,typeof(v)}(v)
1616
Furlong{p,T}(x::Furlong{p,S}) where {T,p,S} = Furlong{p,T}(T(x.val))
1717

1818
Base.promote_type(::Type{Furlong{p,T}}, ::Type{Furlong{p,S}}) where {p,T,S} =
19-
(Base.@_pure_meta; Furlong{p,promote_type(T,S)})
19+
(Base.@_unsafe_pure_meta; Furlong{p,promote_type(T,S)})
2020

2121
Base.one(x::Furlong{p,T}) where {p,T} = one(T)
2222
Base.one(::Type{Furlong{p,T}}) where {p,T} = one(T)

0 commit comments

Comments
 (0)