Skip to content

Commit b6e6e2f

Browse files
authored
Replace -> with :: where appropriate in docstrings (JuliaLang#57012)
In cases where a function is documented as ``` function(arg::ArgT, arg2::Arg2T) -> RetT ... ``` I either switched ` -> ` to `::` or switched `RetT` to `ret_name::RetT`. From the recommendation and justification from @nsajko here: JuliaLang#56978 (comment) and applied throughout the repo. As documented here JuliaLang#57583 Also includes some minor changes to touched lines (e.g. removing annotations that are just clutter)
1 parent 4871d04 commit b6e6e2f

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/abstractlattice.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,23 @@ function ⊑ end
153153
@nospecializeinfer (::JLTypeLattice, @nospecialize(a::Type), @nospecialize(b::Type)) = a <: b
154154

155155
"""
156-
⊏(𝕃::AbstractLattice, a, b) -> Bool
156+
⊏(𝕃::AbstractLattice, a, b)::Bool
157157
158158
The strict partial order over the type inference lattice.
159159
This is defined as the irreflexive kernel of `⊑`.
160160
"""
161161
@nospecializeinfer (𝕃::AbstractLattice, @nospecialize(a), @nospecialize(b)) = (𝕃, a, b) && !(𝕃, b, a)
162162

163163
"""
164-
⋤(𝕃::AbstractLattice, a, b) -> Bool
164+
⋤(𝕃::AbstractLattice, a, b)::Bool
165165
166166
This order could be used as a slightly more efficient version of the strict order `⊏`,
167167
where we can safely assume `a ⊑ b` holds.
168168
"""
169169
@nospecializeinfer (𝕃::AbstractLattice, @nospecialize(a), @nospecialize(b)) = !(𝕃, b, a)
170170

171171
"""
172-
is_lattice_equal(𝕃::AbstractLattice, a, b) -> Bool
172+
is_lattice_equal(𝕃::AbstractLattice, a, b)::Bool
173173
174174
Check if two lattice elements are partial order equivalent.
175175
This is basically `a ⊑ b && b ⊑ a` in the lattice of `𝕃`
@@ -181,7 +181,7 @@ but (optionally) with extra performance optimizations.
181181
end
182182

183183
"""
184-
has_nontrivial_extended_info(𝕃::AbstractLattice, t) -> Bool
184+
has_nontrivial_extended_info(𝕃::AbstractLattice, t)::Bool
185185
186186
Determines whether the given lattice element `t` of `𝕃` has non-trivial extended lattice
187187
information that would not be available from the type itself.
@@ -204,7 +204,7 @@ end
204204
@nospecializeinfer has_nontrivial_extended_info(::JLTypeLattice, @nospecialize(t)) = false
205205

206206
"""
207-
is_const_prop_profitable_arg(𝕃::AbstractLattice, t) -> Bool
207+
is_const_prop_profitable_arg(𝕃::AbstractLattice, t)::Bool
208208
209209
Determines whether the given lattice element `t` of `𝕃` has new extended lattice information
210210
that should be forwarded along with constant propagation.

src/ssair/domtree.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ function rename_nodes!(D::DFSTree, rename_bb::Vector{BBNumber})
595595
end
596596

597597
"""
598-
dominates(domtree::DomTree, bb1::Int, bb2::Int) -> Bool
598+
dominates(domtree::DomTree, bb1::Int, bb2::Int)::Bool
599599
600600
Checks if `bb1` dominates `bb2`.
601601
`bb1` and `bb2` are indexes into the `CFG` blocks.
@@ -606,7 +606,7 @@ dominates(domtree::DomTree, bb1::BBNumber, bb2::BBNumber) =
606606
_dominates(domtree, bb1, bb2)
607607

608608
"""
609-
postdominates(domtree::PostDomTree, bb1::Int, bb2::Int) -> Bool
609+
postdominates(domtree::PostDomTree, bb1::Int, bb2::Int)::Bool
610610
611611
Checks if `bb1` post-dominates `bb2`.
612612
`bb1` and `bb2` are indexes into the `CFG` blocks.

src/tfuncs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,7 +2597,7 @@ const _EFFECTS_KNOWN_BUILTINS = Any[
25972597
]
25982598

25992599
"""
2600-
builtin_effects(𝕃::AbstractLattice, f::Builtin, argtypes::Vector{Any}, rt) -> Effects
2600+
builtin_effects(𝕃::AbstractLattice, f::Builtin, argtypes::Vector{Any}, rt)::Effects
26012601
26022602
Compute the effects of a builtin function call. `argtypes` should not include `f` itself.
26032603
"""
@@ -2742,7 +2742,7 @@ current_scope_tfunc(interp::AbstractInterpreter, sv) = Any
27422742
hasvarargtype(argtypes::Vector{Any}) = !isempty(argtypes) && isvarargtype(argtypes[end])
27432743

27442744
"""
2745-
builtin_nothrow(𝕃::AbstractLattice, f::Builtin, argtypes::Vector{Any}, rt) -> Bool
2745+
builtin_nothrow(𝕃::AbstractLattice, f::Builtin, argtypes::Vector{Any}, rt)::Bool
27462746
27472747
Compute throw-ness of a builtin function call. `argtypes` should not include `f` itself.
27482748
"""

src/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ may_compress(::AbstractInterpreter) = true
441441
may_discard_trees(::AbstractInterpreter) = true
442442

443443
"""
444-
method_table(interp::AbstractInterpreter) -> MethodTableView
444+
method_table(interp::AbstractInterpreter)::MethodTableView
445445
446446
Returns a method table this `interp` uses for method lookup.
447447
External `AbstractInterpreter` can optionally return `OverlayMethodTable` here
@@ -519,7 +519,7 @@ add_edges_impl(::Vector{Any}, ::CallInfo) = error("""
519519
All `CallInfo` is required to implement `add_edges_impl(::Vector{Any}, ::CallInfo)`""")
520520
nsplit_impl(::CallInfo) = nothing
521521
getsplit_impl(::CallInfo, ::Int) = error("""
522-
A `info::CallInfo` that implements `nsplit_impl(info::CallInfo) -> Int` must implement `getsplit_impl(info::CallInfo, idx::Int) -> MethodLookupResult`
522+
A `info::CallInfo` that implements `nsplit_impl(info::CallInfo)::Int` must implement `getsplit_impl(info::CallInfo, idx::Int)::MethodLookupResult`
523523
in order to correctly opt in to inlining""")
524524
getresult_impl(::CallInfo, ::Int) = nothing
525525

src/typeutils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function hasuniquerep(@nospecialize t)
2424
end
2525

2626
"""
27-
isTypeDataType(@nospecialize t) -> Bool
27+
isTypeDataType(@nospecialize t)::Bool
2828
2929
For a type `t` test whether ∀S s.t. `isa(S, rewrap_unionall(Type{t}, ...))`,
3030
we have `isa(S, DataType)`. In particular, if a statement is typed as `Type{t}`
@@ -303,7 +303,7 @@ end
303303
const unwraptv = unwraptv_ub
304304

305305
"""
306-
is_identity_free_argtype(argtype) -> Bool
306+
is_identity_free_argtype(argtype)::Bool
307307
308308
Return `true` if the `argtype` object is identity free in the sense that this type or any
309309
reachable through its fields has non-content-based identity (see `Base.isidentityfree`).
@@ -316,7 +316,7 @@ is_identity_free_argtype(@nospecialize ty) = is_identity_free_type(widenconst(ig
316316
is_identity_free_type(@nospecialize ty) = isidentityfree(ty)
317317

318318
"""
319-
is_immutable_argtype(argtype) -> Bool
319+
is_immutable_argtype(argtype)::Bool
320320
321321
Return `true` if the `argtype` object is known to be immutable.
322322
This query is specifically designed for `getfield_effects` and `isdefined_effects`, allowing
@@ -334,7 +334,7 @@ function _is_immutable_type(@nospecialize ty)
334334
end
335335

336336
"""
337-
is_mutation_free_argtype(argtype) -> Bool
337+
is_mutation_free_argtype(argtype)::Bool
338338
339339
Return `true` if `argtype` object is mutation free in the sense that no mutable memory
340340
is reachable from this type (either in the type itself) or through any fields

src/utilities.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,14 +174,14 @@ isa_compileable_sig(m::ABIOverride) = false
174174
has_typevar(@nospecialize(t), v::TypeVar) = ccall(:jl_has_typevar, Cint, (Any, Any), t, v) != 0
175175

176176
"""
177-
is_declared_inline(method::Method) -> Bool
177+
is_declared_inline(method::Method)::Bool
178178
179179
Check if `method` is declared as `@inline`.
180180
"""
181181
is_declared_inline(method::Method) = _is_declared_inline(method, true)
182182

183183
"""
184-
is_declared_noinline(method::Method) -> Bool
184+
is_declared_noinline(method::Method)::Bool
185185
186186
Check if `method` is declared as `@noinline`.
187187
"""
@@ -195,14 +195,14 @@ function _is_declared_inline(method::Method, inline::Bool)
195195
end
196196

197197
"""
198-
is_aggressive_constprop(method::Union{Method,CodeInfo}) -> Bool
198+
is_aggressive_constprop(method::Union{Method,CodeInfo})::Bool
199199
200200
Check if `method` is declared as `Base.@constprop :aggressive`.
201201
"""
202202
is_aggressive_constprop(method::Union{Method,CodeInfo}) = method.constprop == 0x01
203203

204204
"""
205-
is_no_constprop(method::Union{Method,CodeInfo}) -> Bool
205+
is_no_constprop(method::Union{Method,CodeInfo})::Bool
206206
207207
Check if `method` is declared as `Base.@constprop :none`.
208208
"""

0 commit comments

Comments
 (0)