E0050trait

Method has incorrect number of parameters in trait impl

Impl method's arity disagrees with the trait.

Repro

trait Speak { fn speak(&self, msg: &str); }
impl Speak for Dog {
    fn speak(&self) { println!("woof"); }   // E0050: trait expects 2 params
}

Why

Trait method signatures are contracts. Impls must match — otherwise callers using the trait would invoke a function with the wrong shape.

Fix

- Match the trait signature exactly. Add the missing parameter. - If the impl genuinely doesn't need the parameter, accept and ignore it: fn speak(&self, _msg: &str) { println!("woof"); }. - If the trait should grow a default that doesn't take the param, declare a different method. - After trait refactors, search every impl Trait for for stale signatures.

Patterns that solve this