Rust errors / Types and traits
Rust compiler error · checked with rustc 1.99.0
Rust error E0415: identifier `f` is bound more than once in this parameter list
What it meansMore than one function parameter have the same name.
What rustc prints
error[E0415]: identifier `f` is bound more than once in this parameter list
--> main.rs:1:16
|
1 | fn foo(f: i32, f: i32) {} // error: identifier `f` is bound more than
| ^ used as parameter more than onceReal output of rustc 1.99.0 compiling the official example below (2021 edition). Your names and line numbers will differ; the first line is the part to match.
The compiler team's explanation
More than one function parameter have the same name.
Erroneous code example:
fn foo(f: i32, f: i32) {} // error: identifier `f` is bound more than
// once in this parameter list
Please verify you didn't misspell parameters' name. Example:
fn foo(f: i32, g: i32) {} // ok!From rustc --explain E0415 (1.99.0), part of the Rust project, MIT or Apache-2.0. Official page.
Related errors
- E0308mismatched types
- E0277the trait bound is not satisfied
- E0599no method named X found in the current scope
- E0433failed to resolve
- E0409variable `y` is bound inconsistently across alternatives separated by `|`
- E0411cannot find type `Self` in this scope
- E0416identifier `x` is bound more than once in the same pattern
- E0422cannot find struct, variant or union type `Foo` in this scope
Up next
Often hit nextE0308: mismatched typesA related error from the same family.Read it next →Did this answer your question?