E0011 — Duplicate function definition
Two fn declarations share the same name in the same scope.
What triggers it
The parser or name-resolution pass finds a second top-level (or
same-scope) fn with a name that’s already bound. Overloading by
name alone isn’t supported — use distinct names or generics.
Minimal example
fn add(int a, int b) -> int { return a + b; }
fn add(int a, int b) -> int { return a - b; }
Output:
scratch.rz:2:1: error[E0011]: duplicate function definition `add`
fn add(int a, int b) -> int { return a - b; }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Fix
Rename one of the functions, or fold the two bodies into one if they were meant to be the same function.
fn add(int a, int b) -> int { return a + b; }
fn sub(int a, int b) -> int { return a - b; }
Source
Emitted from the parser’s declaration pass / name-resolution in
resilient/src/lib.rs.