Area
Compiler (frontend/backend/codegen)
Summary
A call to a module-level function emits a mangled incan-v1 symbol at a direct call site, but the unmangled source name when the same call appears inside a lambda. The unmangled name does not exist in the generated crate, so the code fails with E0425.
Both call sites below name the same function in the same module. Only the one inside the lambda is emitted wrongly.
Reproduction steps
def cfg_predicate(predicate: &Predicate, snapshot: CfgSnapshot) -> Option[bool]:
...
def evaluate(expression: Expression, snapshot: CfgSnapshot) -> Option[bool]:
if cfg_predicate(predicate, snapshot) == None: # direct call - emits mangled, resolves
return None
return expression.eval((predicate) => cfg_predicate(predicate, snapshot)) # in a lambda - emits bare name
incan oven bake --project .
Output / logs
Generated Rust, direct call — mangled and resolvable:
if __incan_v1_000100000000000000116f76656e5f6c6f63616c5f696e74616b65...(predicate, snapshot.clone())
Generated Rust, same function inside the lambda — bare name, undefined:
let result: Option<bool> = expression
.eval(|predicate| cfg_predicate(&predicate, snapshot.clone()));
error[E0425]: cannot find function `cfg_predicate` in this scope
--> src/rust_activation.rs:1080:35
The function itself is emitted correctly under its mangled name elsewhere in the same file, so this is purely the reference inside the lambda body.
Environment
Area
Compiler (frontend/backend/codegen)
Summary
A call to a module-level function emits a mangled
incan-v1symbol at a direct call site, but the unmangled source name when the same call appears inside a lambda. The unmangled name does not exist in the generated crate, so the code fails withE0425.Both call sites below name the same function in the same module. Only the one inside the lambda is emitted wrongly.
Reproduction steps
incan oven bake --project .Output / logs
Generated Rust, direct call — mangled and resolvable:
Generated Rust, same function inside the lambda — bare name, undefined:
The function itself is emitted correctly under its mangled name elsewhere in the same file, so this is purely the reference inside the lambda body.
Environment
0.6.0-dev.4at0a8395835, plus the fix onbugfix/1491-rust-struct-variant-patternspubdoes not change the mangling.workspaces/oven(feature - RFC 119 native Rust facets and direct-rustc planning #1037, PR chore - retain the Incan-authored Oven control plane (#1037) #1487).