Ruta graveolens  ·  notes from a language experiment  ·  cultivated since 2025

E0209: Unexpected call argument mode

CodeCategoryStability
E0209SemanticPermanent

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)
}

References