You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rust: main() body has no static-type scope, so string joins and int-to-long widening fail to compile there (E0308/E0277) #338
Every Standard generator except Rust opens a static-type scope around an EntryPoint body:
Go: GoGenerator.cs:2136
C: CGenerator.cs:1205
C++: CppGenerator.cs:808
Python: PythonGenerator.cs:855
JavaScript: JavaScriptGenerator.cs:734
RustGenerator.GenerateEntryPoint (RustGenerator.cs L2142-L2181) never calls OpenStaticTypeScope(entryPoint); Rust only opens one for functions (L1101). RegisterStaticType does nothing when no scope is open, so no local inside fn main(), or inside the run helper generated for an exit-code entry point, has a known type.
Two Rust fixes depend on knowing those types: the format! string join (429d953, #240) and explicit as i64 widening (PR #329, #238). Neither applies inside an entry point.
rustc --edition 2021 rejects it. The same statements inside a FunctionDeclaration produce format!("{}{}", name, bang) and (big + (small as i64)), which compile. Go produces int64(small) for the same entry point.
Suggested fix / acceptance criteria
RustGenerator.GenerateEntryPoint opens OpenStaticTypeScope(entryPoint) around the body in both the plain main branch and the exit-code run branch, as GoGenerator does.
When AcceptsArguments is set, args is bound as Vec<String>.
RustGeneratedSourceCompilesTests compiles an entry point that joins two String locals and adds an int local to a long local.
Activity
matt-edmondson commentedon Oct 25, 2026
Triage
main(), but the compiler catches it.static). Both are Rust scope-tracking bugs and may share a fix. Not a duplicate.Generated by Claude Code