Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,6 @@ JL_DLLEXPORT jl_module_t *jl_get_module_of_binding(jl_module_t *m, jl_sym_t *var

static NOINLINE void print_backdate_admonition(jl_binding_t *b) JL_NOTSAFEPOINT
{
if (jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR)
jl_undefined_var_error(b->globalref->name, (jl_value_t*)b->globalref->mod);
jl_safe_printf(
"WARNING: Detected access to binding `%s.%s` in a world prior to its definition world.\n"
" Julia 1.12 has introduced more strict world age semantics for global bindings.\n"
Expand All @@ -860,9 +858,13 @@ static NOINLINE void print_backdate_admonition(jl_binding_t *b) JL_NOTSAFEPOINT

static inline void check_backdated_binding(jl_binding_t *b, enum jl_partition_kind kind) JL_NOTSAFEPOINT
{
if (__unlikely(kind == PARTITION_KIND_BACKDATED_CONST) &&
!(jl_atomic_fetch_or_relaxed(&b->flags, BINDING_FLAG_DID_PRINT_BACKDATE_ADMONITION) & BINDING_FLAG_DID_PRINT_BACKDATE_ADMONITION)) {
print_backdate_admonition(b);
if (__unlikely(kind == PARTITION_KIND_BACKDATED_CONST)) {
// We don't want functions that inference executes speculatively to print this warning, so turn those into
// an error for inference purposes.
if (jl_current_task->ptls->in_pure_callback || jl_options.depwarn == JL_OPTIONS_DEPWARN_ERROR)
jl_undefined_var_error(b->globalref->name, (jl_value_t*)b->globalref->mod);
if (!(jl_atomic_fetch_or_relaxed(&b->flags, BINDING_FLAG_DID_PRINT_BACKDATE_ADMONITION) & BINDING_FLAG_DID_PRINT_BACKDATE_ADMONITION))
print_backdate_admonition(b);
}
}

Expand Down