Rust

E0050 Wrong Parameter Count Fix

The trait declares a method that takes a name and a punctuation mark, the implementation accepts only the name, and no call site can be satisfied by both. E0050 is the compiler counting the two lists and refusing the mismatch: the fix is never a conversion or a default — it is adding the missing parameter, removing the extra one, or matching the count of a function that has no receiver at all.

Written November 26, 2026 · Tested with Rust 1.99.1 · 9 min read

By the end of this guide
  • The error: too few parameters
  • The error: too many parameters
  • The error: an associated function with no receiver
  • Which fix for which cause

Written November 26, 2026

Tested with Rust 1.99.1

What this guide is

A trait declaration is a contract, and its parameter list is part of that contract. Callers are compiled against the declaration, so an implementation that takes fewer or more parameters than the trait declares cannot stand in for it — there is no call that matches both lists at once. E0050 is the compiler reporting that count mismatch: a method has one number of parameters, and the declaration in its trait has another.

The count includes the receiver. A method declared as fn greet(&self, name: &str, punct: char) has three parameters, not two, because &self is counted on both sides. That single fact explains most confusion around this error: the numbers in the header often look one higher than the arguments a caller passes. The three shapes below differ only in how the count drifts — an implementation that drops a parameter, one that adds a parameter, and one with no receiver to hide the arithmetic — and in each case the repair is to make the implementation's list match the trait's.

The error: too few parameters

This program declares a greet method that takes a name and a punctuation mark, then implements it with only the name:

Rust
trait Greeter {
    fn greet(&self, name: &str, punct: char) -> String;
}

struct Friendly;

impl Greeter for Friendly {
    fn greet(&self, name: &str) -> String {
        format!("Hello, {name}")
    }
}

fn main() {
    let g = Friendly;
    println!("{}", g.greet("Ada", '!'));
}
Terminal
$ rustc --edition 2021 broken_few.rs -o broken_few.bin
error[E0050]: method `greet` has 2 parameters but the declaration in trait `Greeter::greet` has 3
 --> broken_few.rs:8:14
  |
2 |     fn greet(&self, name: &str, punct: char) -> String;
  |              ------------------------------ trait requires 3 parameters
...
8 |     fn greet(&self, name: &str) -> String {
  |              ^^^^^^^^^^^^^^^^^ expected 3 parameters, found 2

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0050`.

The header counts both lists, receiver included: the implementation has 2 parameters (&self and name), the declaration has 3 (&self, name, and punct). The span underlines the implementation's whole parameter list, and the note on the declaration reads trait requires 3 parameters. Nothing in the body is at fault — the method never gets as far as its body, because its shape already breaks the contract.

The fixed program adds the missing parameter and uses it:

Rust
trait Greeter {
    fn greet(&self, name: &str, punct: char) -> String;
}

struct Friendly;

impl Greeter for Friendly {
    fn greet(&self, name: &str, punct: char) -> String {
        format!("Hello, {name}{punct}")
    }
}

fn main() {
    let g = Friendly;
    println!("{}", g.greet("Ada", '!'));
}
Terminal
$ rustc --edition 2021 fixed_few.rs -o fixed_few.bin
$ ./fixed_few.bin
Hello, Ada!

With punct: char restored, the implementation has the same 3 parameters as the declaration, in the same order and with the same types. Adding the parameter is the whole fix; there is no default value to fall back on in a trait implementation, because the count, not the use of the value, is what was wrong — an underscore-prefixed name such as _punct: char would also satisfy the count if the body did not need the value, though here the body does use it, appending the punctuation the caller supplied.

The error: too many parameters

This program declares an add method that takes one value, then implements it with an extra parameter the trait never promised:

Rust
trait Adder {
    fn add(&self, value: i32) -> i32;
}

struct Counter {
    base: i32,
}

impl Adder for Counter {
    fn add(&self, value: i32, extra: i32) -> i32 {
        self.base + value + extra
    }
}

fn main() {
    let c = Counter { base: 10 };
    println!("{}", c.add(5));
}
Terminal
$ rustc --edition 2021 broken_many.rs -o broken_many.bin
error[E0050]: method `add` has 3 parameters but the declaration in trait `Adder::add` has 2
  --> broken_many.rs:10:12
   |
 2 |     fn add(&self, value: i32) -> i32;
   |            ----------------- trait requires 2 parameters
...
10 |     fn add(&self, value: i32, extra: i32) -> i32 {
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected 2 parameters, found 3

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0050`.

The direction is reversed and the error is the same. An extra parameter is not a harmless extension: a caller going through the trait passes one value, so there is nothing to supply extra with, and code that knows about extra cannot call this method through the trait at all. The implementation has invented a different method under the trait method's name.

The fixed program removes the extra parameter and does its work with what the trait supplies:

Rust
trait Adder {
    fn add(&self, value: i32) -> i32;
}

struct Counter {
    base: i32,
}

impl Adder for Counter {
    fn add(&self, value: i32) -> i32 {
        self.base + value
    }
}

fn main() {
    let c = Counter { base: 10 };
    println!("{}", c.add(5));
}
Terminal
$ rustc --edition 2021 fixed_many.rs -o fixed_many.bin
$ ./fixed_many.bin
15

If the extra input is genuinely needed, it does not belong in this method's parameter list: store it on the struct when the value is built, pass it through a separate inherent method that is not part of the trait, or — only as a deliberate redesign — change the trait declaration and every implementation and caller together. What does not work is keeping the extra parameter and hoping trait callers will find a way to fill it.

The error: an associated function with no receiver

This program declares an associated function — a trait function with no self at all — that takes two values, then implements it with one:

Rust
trait Calculator {
    fn compute(left: i32, right: i32) -> i32;
}

struct Doubler;

impl Calculator for Doubler {
    fn compute(left: i32) -> i32 {
        left * 2
    }
}

fn main() {
    println!("{}", Doubler::compute(3, 4));
}
Terminal
$ rustc --edition 2021 broken_assoc.rs -o broken_assoc.bin
error[E0050]: method `compute` has 1 parameter but the declaration in trait `Calculator::compute` has 2
 --> broken_assoc.rs:8:22
  |
2 |     fn compute(left: i32, right: i32) -> i32;
  |                      --------------- trait requires 2 parameters
...
8 |     fn compute(left: i32) -> i32 {
  |                      ^^^ expected 2 parameters, found 1

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0050`.

With no receiver, the counts are exactly the arguments a caller passes, and the mismatch is plain to read: 1 against 2, with the span sitting on the one parameter the implementation kept. This shape is the cleanest check on whether a count problem is really E0050 — if adding or removing a receiver changes the code in the header to a different error, the original problem was never the count. A missing or extra &self by itself is a different defect with a different code, and a missing or extra type parameter is a different defect again; neither is repaired by adjusting the value parameters.

The fixed program restores the second parameter:

Rust
trait Calculator {
    fn compute(left: i32, right: i32) -> i32;
}

struct Doubler;

impl Calculator for Doubler {
    fn compute(left: i32, right: i32) -> i32 {
        left * 2 + right
    }
}

fn main() {
    println!("{}", Doubler::compute(3, 4));
}
Terminal
$ rustc --edition 2021 fixed_assoc.rs -o fixed_assoc.bin
$ ./fixed_assoc.bin
10

The call site never changed: Doubler::compute(3, 4) was written against the trait's two parameters from the start, and it compiles unchanged once the implementation offers both. That is the pattern in all three shapes — the callers follow the declaration, so the implementation is the side that moves.

Which fix for which cause

Cause Message Fix
Implementation drops a parameter E0050, has 2 parameters, declaration has 3 Add the missing parameter to the impl
Implementation adds a parameter E0050, has 3 parameters, declaration has 2 Remove the extra parameter from the impl
Associated function, no receiver E0050, has 1 parameter, declaration has 2 Match the impl list to the trait list exactly

Checklist

  • Count the receiver. &self, &mut self, and self each count as one parameter on both sides of the comparison, so a method with two caller arguments usually shows a count of 3.
  • Read both numbers in the header before editing. The first is the implementation's count, the second is the trait declaration's count, and the difference is exactly how many parameters to add or remove.
  • Change the implementation, not the trait, unless the trait is genuinely wrong. One impl moving is a fix; the contract moving changes every implementation and caller.
  • Keep the order and the types while fixing the count. A list with the right number of parameters in the wrong order, or with a different type, is a different error waiting behind this one.
  • If an extra input is truly needed, store it on the type or use a separate inherent method. Do not leave it in the trait method's list, where trait callers cannot supply it.
  • If the mismatch is only about the receiver itself, or only about type parameters, expect a different error code and a different fix — count repairs apply only when the header itself reports a parameter count.
  • E0053 Method Signature Mismatch Fix — the companion error for a method with the right number of parameters and one wrong type inside the signature, where this guide covers the method whose count itself is wrong.
  • Fix Rust E0046 "missing trait items" — the error for a trait item that is absent from the implementation altogether, rather than present with the wrong shape.
  • E0407 Method Not in Trait Fix — the error for a method the implementation adds that the trait never declared, the mirror image of a declared method implemented incorrectly.
  • Fix Rust E0308 "mismatched types" — the general type-mismatch repair manual, for the errors that appear at call sites and expressions once the trait signatures agree.

Sources

  • Rust Compiler Error Index, E0050 — for an attempted implementation of a trait method having the wrong number of function parameters, for the receiver counting as a parameter, and for the fix of giving the implementation the same parameters as the declaration.
  • The Rust Book, Traits: Defining Shared Behavior — for a trait method signature ending in a semicolon, for each implementing type providing its own body, and for the compiler enforcing that the method is defined with the trait's signature exactly.
  • The Rust Reference, Traits — for a trait function omitting its body by replacing it with a semicolon to indicate that the implementation must define the function.

Keep Exploring