Warnings if a module implicitly imports a deprecated binding
A MWE: Start julia --depwarn=error and execute
julia> using Documenter
julia> module E
module B
struct C end
export C
Base.@deprecate_binding D C
end
using .B
export C, D
end
Main.E
julia> Documenter.submodules(E)
WARNING: using deprecated binding B.D in E.
, use C instead.
Set{Module} with 2 elements:
Main.E.B
Main.E
The problem is that isdefined (and isdeprecated) in https://github.com/JuliaDocs/Documenter.jl/blob/76e83a1307cd318a7a55bcf0afe5073397d8d659/src/utilities/utilities.jl#L221 implicitly resolve the binding which triggers the deprecation warning. Changing the line to
if Base.isidentifier(name) && Base.isbindingresolved(root, name) && isdefined(root, name) && !isdeprecated(root, name)
seems to fix the issue.
That being said, this problem is only present in Julia < 1.12 (the MWE works successfully in e.g. 1.12.0-rc1). In February, Keno removed the need for Base.isbindingresolved (it's deprecated in 1.12 and just unconditionally returns true) in https://github.com/JuliaLang/julia/pull/57253, and in the same PR also remove these patterns isbindingresolved(...) && isdefined(...) and isbindingresolved(...) && !isdeprecated(...) in base julia. Since the current LTS is 1.10 one might argue that it's still worth fixing this issue in Documenter on Julia 1.10 and 1.11.