E0209: Unexpected call argument mode
| Code | Category | Stability |
|---|---|---|
E0209 | Semantic | Permanent |
Explanation
A call marked an argument borrow or inout, but the corresponding parameter is an ordinary unmarked parameter.
Likely cause
The call-site mode does not exactly match the function signature. Remove the keyword for a by-value parameter, or change the parameter mode if the function is meant to borrow or mutate caller-owned storage.
Examples
Borrow marker for an unmarked parameter
fn take(value: i32) -> i32 { value }
fn main() -> i32 {
let value = 42;
take(borrow value)
}
Match the parameter mode
fn take(value: i32) -> i32 { value }
fn main() -> i32 {
let value = 42;
take(value)
}