Rust
E0034 Multiple Applicable Items Fix
Two traits, one type, one item name: when both traits are implemented and the call names only the item, the compiler lists the candidates and stops rather than guessing. This guide works the shapes that produce E0034, shows the fully-qualified and trait-qualified repairs the diagnostic itself proposes, and separates the neighboring shapes - an inherent method, an associated type, a glob-import collision - that resolve differently or fail under different codes.
Written November 30, 2026 · Tested with Rust 1.99.1 · 20 min read
- The rule underneath: a bare name does not pick a winner
- How to read the diagnostic
- The first failure: an associated function on two traits
- The method-call form
Written November 30, 2026
Tested with Rust 1.99.1
What this guide is
Error E0034 is an ambiguous item lookup. The error codes index opens with the cause in one sentence - "The compiler doesn't know what method to call because more than one method has the same prototype" - and its erroneous example is the first failure in this guide: a type implementing two traits that both define an associated function foo, called as Test::foo(). Its fixes are the two moves this guide is built around: keep only one of the candidates, or name the one you mean with "fully explicit naming of type and trait", as in <Test as Trait1>::foo().
The practical payoff is that E0034 is never a mystery about which items exist - the diagnostic lists them. Every failing program below prints both candidates, each with a note naming the trait and the type it was implemented for, and a help block offering the disambiguated forms. The repair is therefore a choice, not a search: decide which trait's item the call means, then write that choice into the call. The neighboring guide on E0659 covers ambiguity of imported names themselves; this guide is about ambiguity of items on a type, and links that guide only where a glob import produces the other code.
Build every program in this guide with rustc --edition 2021. In the compiler transcripts below, the file names are the bare names shown on the command line.
The rule underneath: a bare name does not pick a winner
A method call or an associated-item path starts from a name. The method call expressions section of the Rust Reference describes the search: for each candidate receiver type, the compiler looks first at the type's inherent methods, then at "any of the methods provided by a visible trait implemented by" that type. When that search lands on exactly one item, the call is settled. When it lands on two trait items with the same name - both traits implemented for the type and both visible - there is no further rule to break the tie, and the lookup fails with E0034 instead of preferring one trait over the other.
The same holds off the method-call path. An associated function called as S::make() and an associated constant read as S::VALUE go through the same kind of name lookup against the type's applicable items, and both fail below with the same code and the same candidate list. What the lookup keys on, in every failing program in this guide, is the item's name on the type - not its full signature, as the differing-signatures program below shows.
Disambiguation is a path feature, not a call-site trick. The Reference's paths section states that fully qualified paths "allow for disambiguating the path for trait implementations": <S as A>::name names the item as reached through one specific trait implementation, so the lookup has exactly one candidate again.
How to read the diagnostic
The header is fixed: "multiple applicable items in scope". The label under the item name repeats it per item - "multiple foo found", "multiple name found", "multiple VALUE found". Then come the candidate notes, one per candidate, each in the same form: "candidate #1 is defined in an impl of the trait Trait1 for the type Test", with a span pointing at that candidate's definition. Read the notes as the menu: they name exactly the traits the fully-qualified repair can choose between.
The help block then writes the repair for you, once per candidate. For associated functions and constants it offers "use fully-qualified syntax to disambiguate" and shows each <Type as Trait>::item form as a replacement line. For method calls it offers "disambiguate the method for candidate #1" (and #2) and shows the trait-qualified call form, A::name(&s), instead. In the same-signature programs in this guide, either offered form compiles - the fixes section runs both - so the only decision the diagnostic leaves you is which candidate is the intended one. The differing-signatures program below is the exception: its help still offers A::go(&s) for the candidate that takes an extra argument, and that offered form does not compile until the argument is supplied.
The first failure: an associated function on two traits
This is the error index's own example, as a complete program - two traits defining foo, both implemented for Test, called through the type alone:
struct Test;
trait Trait1 { fn foo(); }
trait Trait2 { fn foo(); }
impl Trait1 for Test { fn foo() {} }
impl Trait2 for Test { fn foo() {} }
fn main() { Test::foo(); }
error[E0034]: multiple applicable items in scope
--> q1.rs:6:19
|
6 | fn main() { Test::foo(); }
| ^^^ multiple `foo` found
|
note: candidate #1 is defined in an impl of the trait `Trait1` for the type `Test`
--> q1.rs:4:24
|
4 | impl Trait1 for Test { fn foo() {} }
| ^^^^^^^^
note: candidate #2 is defined in an impl of the trait `Trait2` for the type `Test`
--> q1.rs:5:24
|
5 | impl Trait2 for Test { fn foo() {} }
| ^^^^^^^^
help: use fully-qualified syntax to disambiguate
|
6 - fn main() { Test::foo(); }
6 + fn main() { <Test as Trait1>::foo(); }
|
6 - fn main() { Test::foo(); }
6 + fn main() { <Test as Trait2>::foo(); }
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
Nothing here is missing: both implementations exist and both are in scope. The call Test::foo() names the type and the item but not the trait, and with two applicable foo items the compiler refuses to pick. Note that the help offers both fully-qualified forms as equally valid replacements - the compiler is asking which trait you mean, not reporting that one of them is wrong.
The method-call form
The same collision through dot syntax - two traits defining a method name for the same type:
struct S;
trait A { fn name(&self) -> i32; }
trait B { fn name(&self) -> i32; }
impl A for S { fn name(&self) -> i32 { 1 } }
impl B for S { fn name(&self) -> i32 { 2 } }
fn main() { let s = S; println!("{}", s.name()); }
error[E0034]: multiple applicable items in scope
--> q2.rs:6:41
|
6 | fn main() { let s = S; println!("{}", s.name()); }
| ^^^^ multiple `name` found
|
note: candidate #1 is defined in an impl of the trait `A` for the type `S`
--> q2.rs:4:16
|
4 | impl A for S { fn name(&self) -> i32 { 1 } }
| ^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `B` for the type `S`
--> q2.rs:5:16
|
5 | impl B for S { fn name(&self) -> i32 { 2 } }
| ^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
|
6 - fn main() { let s = S; println!("{}", s.name()); }
6 + fn main() { let s = S; println!("{}", A::name(&s)); }
|
help: disambiguate the method for candidate #2
|
6 - fn main() { let s = S; println!("{}", s.name()); }
6 + fn main() { let s = S; println!("{}", B::name(&s)); }
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
The candidate notes and the structure are identical to the associated-function case; only the offered repair changes shape. Because the failing expression is a method call, the help rewrites it as a trait-qualified call with the receiver passed explicitly - A::name(&s) or B::name(&s) - rather than showing the angle-bracket form, though that form works too and is run in the fixes section.
An associated constant, and a second associated function
Associated items other than functions collide the same way. A constant defined by two traits, read through the type:
struct S;
trait A { const VALUE: i32; }
trait B { const VALUE: i32; }
impl A for S { const VALUE: i32 = 1; }
impl B for S { const VALUE: i32 = 2; }
fn main() { println!("{}", S::VALUE); }
error[E0034]: multiple applicable items in scope
--> q3.rs:6:31
|
6 | fn main() { println!("{}", S::VALUE); }
| ^^^^^ multiple `VALUE` found
|
note: candidate #1 is defined in an impl of the trait `A` for the type `S`
--> q3.rs:4:16
|
4 | impl A for S { const VALUE: i32 = 1; }
| ^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `B` for the type `S`
--> q3.rs:5:16
|
5 | impl B for S { const VALUE: i32 = 2; }
| ^^^^^^^^^^^^^^^^
help: use fully-qualified syntax to disambiguate
|
6 - fn main() { println!("{}", S::VALUE); }
6 + fn main() { println!("{}", <S as A>::VALUE); }
|
6 - fn main() { println!("{}", S::VALUE); }
6 + fn main() { println!("{}", <S as B>::VALUE); }
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
And an associated function under a different name and type, to show the first failure was not specific to the index's example:
struct S;
trait A { fn make() -> i32; }
trait B { fn make() -> i32; }
impl A for S { fn make() -> i32 { 1 } }
impl B for S { fn make() -> i32 { 2 } }
fn main() { println!("{}", S::make()); }
error[E0034]: multiple applicable items in scope
--> q6.rs:6:31
|
6 | fn main() { println!("{}", S::make()); }
| ^^^^ multiple `make` found
|
note: candidate #1 is defined in an impl of the trait `A` for the type `S`
--> q6.rs:4:16
|
4 | impl A for S { fn make() -> i32 { 1 } }
| ^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `B` for the type `S`
--> q6.rs:5:16
|
5 | impl B for S { fn make() -> i32 { 2 } }
| ^^^^^^^^^^^^^^^^
help: use fully-qualified syntax to disambiguate
|
6 - fn main() { println!("{}", S::make()); }
6 + fn main() { println!("{}", <S as A>::make()); }
|
6 - fn main() { println!("{}", S::make()); }
6 + fn main() { println!("{}", <S as B>::make()); }
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
In both programs the header, the "multiple ... found" label, the candidate notes, and the fully-qualified help are the same as in the foo program. In this guide's probed set, E0034 is one diagnostic for the whole family: method, associated function, or associated constant, whenever a bare name on a type reaches two trait implementations of that name.
The candidates are matched by name, not by signature
It is tempting to expect the argument list to settle a method collision - if only one candidate takes no arguments, surely that one is meant. In the probed set it does not. Here the two go candidates have different signatures, one taking an extra i32 and one taking only the receiver, and the no-argument call still fails:
struct S;
trait A { fn go(&self, x: i32) -> i32; }
trait B { fn go(&self) -> i32; }
impl A for S { fn go(&self, x: i32) -> i32 { x } }
impl B for S { fn go(&self) -> i32 { 9 } }
fn main() { let s = S; println!("{}", s.go()); }
error[E0034]: multiple applicable items in scope
--> q5.rs:6:41
|
6 | fn main() { let s = S; println!("{}", s.go()); }
| ^^ multiple `go` found
|
note: candidate #1 is defined in an impl of the trait `A` for the type `S`
--> q5.rs:4:16
|
4 | impl A for S { fn go(&self, x: i32) -> i32 { x } }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in an impl of the trait `B` for the type `S`
--> q5.rs:5:16
|
5 | impl B for S { fn go(&self) -> i32 { 9 } }
| ^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
|
6 - fn main() { let s = S; println!("{}", s.go()); }
6 + fn main() { let s = S; println!("{}", A::go(&s)); }
|
help: disambiguate the method for candidate #2
|
6 - fn main() { let s = S; println!("{}", s.go()); }
6 + fn main() { let s = S; println!("{}", B::go(&s)); }
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0034`.
Both candidates are listed, and the help offers both trait-qualified forms - including A::go(&s), the candidate whose signature the call as written could not have used. Do not rely on arity or argument types to steer an ambiguous name in this shape: name the trait, as the fixes below do.
The traps: neighbors that are not E0034
An associated type defined by two traits, named through the type, is E0223 - "ambiguous associated type" - not E0034:
struct S;
trait A { type Item; }
trait B { type Item; }
impl A for S { type Item = i32; }
impl B for S { type Item = i32; }
fn f(x: S::Item) -> i32 { x }
fn main() { println!("{}", f(3)); }
error[E0223]: ambiguous associated type
--> q4.rs:6:9
|
6 | fn f(x: S::Item) -> i32 { x }
| ^^^^^^^
|
help: use fully-qualified syntax
|
6 - fn f(x: S::Item) -> i32 { x }
6 + fn f(x: <S as A>::Item) -> i32 { x }
|
6 - fn f(x: S::Item) -> i32 { x }
6 + fn f(x: <S as B>::Item) -> i32 { x }
|
6 - fn f(x: S::Item) -> i32 { x }
6 + fn f(x: <S as IntoAsyncIterator>::Item) -> i32 { x }
|
6 - fn f(x: S::Item) -> i32 { x }
6 + fn f(x: <S as IntoIterator>::Item) -> i32 { x }
|
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0223`.
The repair it offers is the same fully-qualified syntax, but the code and header differ, and its help even lists standard-library traits the type could implement as further candidates. If your ambiguity is over an associated type, you are in E0223 territory, not this guide's.
A name collision between two glob imports is E0659, the ambiguous-name error covered by the neighboring guide. Two modules each define a Thing, both are glob-imported, and the bare name fails before any item lookup on a type happens:
mod a { pub struct Thing; }
mod b { pub struct Thing; }
use a::*;
use b::*;
fn main() { let _t = Thing; }
error[E0659]: `Thing` is ambiguous
--> n3.rs:5:22
|
5 | fn main() { let _t = Thing; }
| ^^^^^ ambiguous name
|
= note: ambiguous because of multiple glob imports of a name in the same module
note: `Thing` could refer to the unit struct imported here
--> n3.rs:3:5
|
3 | use a::*;
| ^^^^
= help: consider adding an explicit import of `Thing` to disambiguate
note: `Thing` could also refer to the unit struct imported here
--> n3.rs:4:5
|
4 | use b::*;
| ^^^^
= help: consider adding an explicit import of `Thing` to disambiguate
warning: unused import: `b::*`
--> n3.rs:4:5
|
4 | use b::*;
| ^^^^
|
= note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default
error: aborting due to 1 previous error; 1 warning emitted
For more information about this error, try `rustc --explain E0659`.
And a trait method called on a type that does not implement the trait at all is not ambiguity - it is absence, E0599:
struct S;
trait A { fn name(&self) -> i32; }
fn main() { let s = S; println!("{}", s.name()); }
error[E0599]: no method named `name` found for struct `S` in the current scope
--> n4.rs:3:41
|
1 | struct S;
| -------- method `name` not found for this struct
2 | trait A { fn name(&self) -> i32; }
3 | fn main() { let s = S; println!("{}", s.name()); }
| ^^^^ method not found in `S`
|
= help: items from traits can only be used if the trait is implemented and in scope
note: `A` defines an item `name`, perhaps you need to implement it
--> n4.rs:2:1
|
2 | trait A { fn name(&self) -> i32; }
| ^^^^^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0599`.
The line between the codes is what the name lookup found: two applicable trait items on the type is E0034, two imported names is E0659, an ambiguous associated type is E0223, and no applicable item is E0599.
The shape that does not fail: an inherent method wins
Not every same-name pair is ambiguous. When the type itself defines an inherent method with the same name as a trait method, the inherent method is the one the call uses - consistent with the Reference's search order, which looks at a type's inherent methods before trait-provided ones. This program compiles and runs:
struct S;
trait A { fn name(&self) -> i32; }
impl S { fn name(&self) -> i32 { 7 } }
impl A for S { fn name(&self) -> i32 { 1 } }
fn main() { let s = S; println!("{}", s.name()); }
7
The output is 7, the inherent implementation's return, not the trait's 1. Do not generalize this past what it shows: it is the inherent-versus-trait pairing that resolves silently in this guide's probed set, while two trait items of the same name - the pairings in every failing program above - do not resolve at all.
A second non-failure comes from scope. A trait method is a candidate only when its trait is in scope, so where two traits are implemented but only one is imported, the call has one candidate and compiles:
mod m { pub trait A { fn name(&self) -> i32; } pub trait B { fn name(&self) -> i32; } }
struct S;
impl m::A for S { fn name(&self) -> i32 { 1 } }
impl m::B for S { fn name(&self) -> i32 { 2 } }
use m::A;
fn main() { let s = S; println!("{}", s.name()); }
1
The output is 1, the in-scope trait A's implementation. This is also a repair strategy, used deliberately in the last fix below: narrow the scope, and the ambiguity goes with it.
Fixes in reach order
When E0034 appears, name the intended trait in the call - the diagnostic's own help is the first fix. For an associated function, the fully-qualified form names the type and the trait:
struct Test;
trait Trait1 { fn foo() -> i32; }
trait Trait2 { fn foo() -> i32; }
impl Trait1 for Test { fn foo() -> i32 { 1 } }
impl Trait2 for Test { fn foo() -> i32 { 2 } }
fn main() { println!("{} {}", <Test as Trait1>::foo(), <Test as Trait2>::foo()); }
1 2
The output is 1 2: each fully-qualified call reached its own trait's implementation, in the order written. The same form repairs the method collision, with the receiver passed as the first argument:
struct S;
trait A { fn name(&self) -> i32; }
trait B { fn name(&self) -> i32; }
impl A for S { fn name(&self) -> i32 { 1 } }
impl B for S { fn name(&self) -> i32 { 2 } }
fn main() { let s = S; println!("{} {}", <S as A>::name(&s), <S as B>::name(&s)); }
1 2
The output is again 1 2. For method calls there is also the shorter trait-qualified form the diagnostic itself offers - the trait name, the method, and the receiver explicitly:
struct S;
trait A { fn name(&self) -> i32; }
trait B { fn name(&self) -> i32; }
impl A for S { fn name(&self) -> i32 { 1 } }
impl B for S { fn name(&self) -> i32 { 2 } }
fn main() { let s = S; println!("{} {}", A::name(&s), B::name(&s)); }
1 2
The output is 1 2, the same two implementations reached without the angle brackets. Prefer this form at method-call sites when the receiver is a simple expression; use the fully-qualified form when the path needs to appear in a type position or when the trait-qualified form would be unclear. The fully-qualified form also repairs the associated constant:
struct S;
trait A { const VALUE: i32; }
trait B { const VALUE: i32; }
impl A for S { const VALUE: i32 = 1; }
impl B for S { const VALUE: i32 = 2; }
fn main() { println!("{} {}", <S as A>::VALUE, <S as B>::VALUE); }
1 2
The output is 1 2: <S as A>::VALUE is 1 and <S as B>::VALUE is 2, each constant read from its own trait's implementation.
Second, if only one of the traits should be visible at the call site at all, narrow the scope instead of qualifying every call - import the one trait inside the block that uses it:
mod m { pub trait A { fn name(&self) -> i32; } pub trait B { fn name(&self) -> i32; } }
struct S;
impl m::A for S { fn name(&self) -> i32 { 1 } }
impl m::B for S { fn name(&self) -> i32 { 2 } }
fn main() { let s = S; { use m::A; println!("{}", s.name()); } }
1
The output is 1. This is the honest fix when the second trait was imported by accident, typically through a glob import or a prelude-style use that outgrew its welcome: the call site never wanted both traits, so removing one from scope states that directly. Do not use it to hide a genuine choice - if both traits are legitimately in play at the site, qualify the calls instead.
Third, the error index's first suggestion: keep only one candidate. If one of the implementations should not exist - a trait implemented during an experiment and never removed, or a duplicate left by a refactor - deleting it leaves a single candidate and the original bare call compiles unchanged:
struct Test;
trait Trait1 { fn foo() -> i32; }
impl Trait1 for Test { fn foo() -> i32 { 1 } }
fn main() { println!("{}", Test::foo()); }
1
The output is 1, reached through the unqualified Test::foo() that failed in the first program. Last, if the diagnostic is not E0034 at all, switch playbooks: an associated type is E0223 (same fully-qualified repair, different code), an imported-name collision is E0659 (see the neighboring guide), and a missing implementation is E0599, which no amount of qualifying will fix.
Decision summary
E0034, "multiple applicable items in scope", is one shape in this guide's probed set: a method call, an associated function, or an associated constant named on a type that implements two traits defining an item of that name, with both traits in scope. The diagnostic lists both candidates with the trait and type each belongs to, and offers the disambiguated forms in its help. The candidates are matched by name - differing signatures did not separate them in the probed differing-signature program. The repairs name the choice: fully-qualified <Type as Trait>::item syntax for any associated item, the shorter Trait::method(&receiver) form for method calls, narrowing the traits in scope when one was never wanted at the site, or removing an implementation that should not exist. The neighbors are distinct: an inherent method of the same name wins silently over a trait method, an ambiguous associated type is E0223, a glob-imported name collision is E0659, and a trait item with no implementation is E0599.
Checklist
- Read the candidate notes first - they name the exact traits the fully-qualified repair chooses between.
- Qualify the call, do not rename your own item to dodge a collision with a trait you need.
- Use
<Type as Trait>::itemfor associated functions and constants; either that form orTrait::method(&receiver)for method calls. - Do not expect argument lists or signatures to disambiguate - in the probed set the lookup keys on the item name.
- Narrow the imports when one trait was never meant to be in scope at the call site; qualify instead when both are genuinely in play.
- Tell E0034 from its neighbors by what the lookup found: two trait items on a type is E0034, an associated type is E0223, two imported names is E0659, no implementation is E0599.
Related guides on this site
- Type Parameters on Foreign Items E0044 Fix
- E0046 Missing Trait Items Fix
- E0091 Unused Type Parameter Fix
- E0084 Unsupported Representation Fix
Sources
- Rust error codes index, E0034 - the compiler does not know what method to call because more than one method has the same prototype; the erroneous example with two traits defining
foofor one type; the fixes of keeping only one candidate and using fully explicit naming of type and trait. - The Rust Reference, Method call expressions - the method lookup procedure: candidate receiver types, then for each type its inherent methods first, then the methods provided by a visible trait implemented by that type.
- The Rust Reference, Paths - fully qualified paths allow for disambiguating the path for trait implementations, with the
<S as T1>::f()/<S as T2>::f()example form.
Keep Exploring
The full Rust hub \u2014 ownership, structs and enums, async, and measured comparisons.
Every guide on the site in one list, grouped by topic.
Every browser-only checker and verifier on the site.
The C++, Python, Sysadmin, Rust, Go, and TypeScript hubs.