Follow-up to #300 / #333, recorded as a scope decision on that PR. Each item is a name coincidence — a user-chosen identifier that spells something RustCall generates or imports — that #333 does not detect. None affects a crate whose names do not collide; all should fail closed with a message rather than reach rustc / Julia as a duplicate definition.
Raised by Codex on #333 round 4:
Manifest::symbol_owners lists primary symbols only. A crate-root #[julia] fn a__run_take_panic() next to #[julia] mod a { #[julia] fn run } makes the root wrapper's entry symbol equal to a::run's panic reader (rustcall_a__run_take_panic); claim_symbols in rustcall-extract does not see it. Include every derived export — <symbol>_take_panic, __RUSTCALL_PANIC_<SYMBOL>, <owner>_RustCallOwnedString / _free_rust_string / _RustCallBorrowedString, <stem>_clone — the way pyo3::wrapper_symbols / string_helper_symbols already do for the PyO3 scan. Best done by sharing one "every symbol this entry claims" function between the two.
- Inline expansion has no crate-wide symbol check.
expand::symbol_collisions is lexical-module-local; a rust""" block with root #[julia] fn a__run() and mod a { #[julia] fn run } reaches rustc with two rustcall_a__run. Run the same crate-wide check (item 1) over the expanded manifest and emit a compile_error! naming both items.
_check_module_names checks child-module names only. Rust allows #[julia] fn C() and #[julia] struct C in one module (value vs. type namespace); the Julia emitters define function C then mutable struct C. Detect collisions among the bindings accumulated within a node (functions, structs, methods, accessors), not only against child modules. This also covers the pre-existing crate-root case.
- Names implicitly imported from
Base. A child module named like a Base export (String, Vector, println, …) passes _julia_module_name; module String inside the generated module conflicts with the implicit using Base. Reserve names(Base) (and Core) in _check_module_names, or map such module names.
Tests to add alongside: deps/rustcall_core/tests/symbols.rs (1, 2), test/test_module_symbols.jl (3, 4).
🤖 Generated with Claude Code
https://claude.ai/code/session_014iJ1dZ7KEebWDjdY7fhPbw
Follow-up to #300 / #333, recorded as a scope decision on that PR. Each item is a name coincidence — a user-chosen identifier that spells something RustCall generates or imports — that #333 does not detect. None affects a crate whose names do not collide; all should fail closed with a message rather than reach rustc / Julia as a duplicate definition.
Raised by Codex on #333 round 4:
Manifest::symbol_ownerslists primary symbols only. A crate-root#[julia] fn a__run_take_panic()next to#[julia] mod a { #[julia] fn run }makes the root wrapper's entry symbol equal toa::run's panic reader (rustcall_a__run_take_panic);claim_symbolsinrustcall-extractdoes not see it. Include every derived export —<symbol>_take_panic,__RUSTCALL_PANIC_<SYMBOL>,<owner>_RustCallOwnedString/_free_rust_string/_RustCallBorrowedString,<stem>_clone— the waypyo3::wrapper_symbols/string_helper_symbolsalready do for the PyO3 scan. Best done by sharing one "every symbol this entry claims" function between the two.expand::symbol_collisionsis lexical-module-local; arust"""block with root#[julia] fn a__run()andmod a { #[julia] fn run }reaches rustc with tworustcall_a__run. Run the same crate-wide check (item 1) over the expanded manifest and emit acompile_error!naming both items._check_module_nameschecks child-module names only. Rust allows#[julia] fn C()and#[julia] struct Cin one module (value vs. type namespace); the Julia emitters definefunction Cthenmutable struct C. Detect collisions among the bindings accumulated within a node (functions, structs, methods, accessors), not only against child modules. This also covers the pre-existing crate-root case.Base. A child module named like aBaseexport (String,Vector,println, …) passes_julia_module_name;module Stringinside the generated module conflicts with the implicitusing Base. Reservenames(Base)(andCore) in_check_module_names, or map such module names.Tests to add alongside:
deps/rustcall_core/tests/symbols.rs(1, 2),test/test_module_symbols.jl(3, 4).🤖 Generated with Claude Code
https://claude.ai/code/session_014iJ1dZ7KEebWDjdY7fhPbw