Rust E0599: no method named found for type in the current scope
E0599 means no candidate method is visible. Import the trait, unify duplicate crate versions, fix the receiver, or enable the Cargo feature.

Introduction & Quick Summary
error[E0599]: no method named `to_lowercase` found for struct `Uuid` in the current scope
--> src/main.rs:6:20
|
6 | println!("{}", id.to_lowercase());
| ^^^^^^^^^^^^ method not found in `Uuid`E0599 means the method exists nowhere the compiler can see for that type. Rust does not have runtime method lookup: a method is only callable when a trait that declares it is in scope, or when it is an inherent method on the type. Four causes:
- The trait is not imported.
Uuidhasto_string, notto_lowercase; the method that could work is often on a trait such asToStringor a crate extension trait. - Two versions of a crate are in the graph. A trait implemented for
chrono 0.4.38does not apply to achrono 0.4.39value, and the method disappears. - The receiver is the wrong shape. The method is on
&Tand the value isRc<T>, or the method takesselfand the value is behindOption, so the compiler suggests a different type in itshelp:line. - A feature is not enabled.
serde'sSerializemethods,tokio's extension traits, and many builder methods are behind Cargo features.
| Message detail | Meaning | Fix |
|---|---|---|
help: items from traits can only be used if the trait is in scope | Trait import missing | Add use path::Trait; |
help: the method is available for Box<T> here | Receiver shape | Deref, clone, or use * |
help: trait X is implemented but not in scope | Crate present, trait not imported | Import the trait |
note: the method was found for chrono::DateTime<Utc> with two versions | Duplicate crate | Unify versions |
the following trait bounds were not satisfied | Generic bound missing | Add T: Trait |
Core Mechanics, Signatures & Reproducible Setup
Method resolution tries inherent methods first, then trait methods from traits in scope, then auto-deref and auto-ref steps on the receiver. If no candidate matches, the compiler emits E0599 and lists the types it did find the method on. The help: suggestions are the useful part: they name the trait or the receiver shape that would work.
A reproduction is one missing import:
// Cargo.toml
// [dependencies]
// chrono = { version = "0.4", default-features = false, features = ["clock"] }
use chrono::Utc;
fn main() {
let now = Utc::now();
println!("{}", now.format("%Y-%m-%d")); // E0599 without the feature/import
}error[E0599]: no method named `format` found for struct `chrono::DateTime<Utc>` in the current scope
--> src/main.rs:6:20use chrono::{DateTime, Utc};
fn main() {
let now: DateTime<Utc> = Utc::now();
println!("{}", now.format("%Y-%m-%d").to_string());
}The trait that provides the method has to be imported, and the type alias has to resolve to the same crate version the impl belongs to.
Key Comparison Table
Several error codes look similar and mean different things. Reading the code first avoids chasing the wrong fix.
| Code | Message | What it means | Where to look |
|---|---|---|---|
E0599 | no method named x found for type T | No candidate method | Trait import, version, receiver |
E0277 | the trait bound T: Trait is not satisfied | Type does not implement the trait | Bound, impl, feature |
E0433 | failed to resolve: use of undeclared crate or module | Path does not exist | Dependencies, use path |
E0412 | cannot find type T in this scope | Name not imported | Imports |
E0609 | no field f on type T | Field is private or absent | Struct definition |
Duplicate crate versions produce a distinctive set of symptoms, and cargo tree -d is the direct check.
| Symptom | cargo tree -d output | Effect |
|---|---|---|
| Trait method missing on a value from another crate | Two versions of that crate | Impl belongs to the other version |
expected crate::T, found crate::T in a function call | Two versions of that crate | Types are distinct |
TryFrom or Into conversion missing | Two versions of the trait's crate | Coherence is per version |
| Builds locally, fails in CI | Lockfile not committed | Resolver picked another version |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
Import the trait, not just the type
An extension trait is only usable when imported. The compiler's help: line names it, so the fix is a one-line use.
use std::io::{self, Read};
fn read_all() -> io::Result<String> {
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer)?; // E0599 without `Read`
Ok(buffer)
}use std::io::{self, Read};
fn read_all() -> io::Result<String> {
let mut buffer = String::new();
io::stdin().read_to_string(&mut buffer)?; // ok: Read is in scope
Ok(buffer)
}Read is never used as a type, so removing it looks harmless to a linter that only checks named types; cargo check catches the missing method immediately.
Unify two versions of the same crate
When a trait impl and the value come from different versions, no import fixes it. cargo tree -d prints the duplicates and cargo tree -i <crate> shows who requires them.
cargo tree -d
# chrono v0.4.38
# └── lib-a v1.0.0
# chrono v0.4.39
# └── lib-b v2.0.0cargo update -p chrono --precise 0.4.39
cargo tree -d
cargo check# force one version when a dependency pins an older release
[patch.crates-io]
chrono = { version = "0.4.39" }[patch.crates-io] only works when the patch resolves to the same source; a git dependency needs [patch."https://github.com/..."]. After patching, run cargo update -p chrono so the lockfile picks up the change.
Receiver shape and auto-deref
Auto-deref covers &T, &mut T, and Box<T>, but not Rc<T>, Option<T>, or a tuple struct without Deref. The compiler's suggestion names the type where the method exists.
use std::rc::Rc;
fn label(name: Rc<String>) -> String {
name.to_uppercase() // E0599: the method exists on String, not Rc<String>
}use std::rc::Rc;
fn label(name: Rc<String>) -> String {
name.as_str().to_uppercase()
}Auto-deref stops at types that do not implement Deref, so Rc and Arc need an explicit as_str, &**value, or a method call that forwards through Deref in the standard library.
Feature gates
A method that exists in the source but is compiled out by a feature produces E0599 with no other hint. The fix is in Cargo.toml, not in the code.
[dependencies]
serde = { version = "1", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }cargo check --all-features
cargo tree -e features -i serde | head -20Checking with --all-features separates a feature problem from a code problem; if it compiles there and not in the default build, the manifest is the issue.
Generic bounds
Inside a generic function, the method is only available when the bound is declared. E0599 on a type parameter usually comes with an E0277 note that names the missing bound.
fn describe<T>(value: T) -> String {
value.to_string() // E0599: T does not implement Display
}fn describe<T: std::fmt::Display>(value: T) -> String {
value.to_string()
}Adding + ?Sized or a separate where clause is equivalent; the important part is that the bound names the trait that provides the method.
Method name collisions between traits
Two traits in scope can both provide a method with the same name, and the call becomes ambiguous (E0034) rather than E0599. A fully qualified call resolves it, and importing only one trait avoids it.
trait A { fn run(&self) -> &'static str; }
trait B { fn run(&self) -> &'static str; }
struct S;
impl A for S { fn run(&self) -> &'static str { "a" } }
impl B for S { fn run(&self) -> &'static str { "b" } }
fn main() {
let s = S;
println!("{}", s.run()); // E0034: multiple applicable items in scope
println!("{}", A::run(&s));
}Importing both traits is legitimate; the call site needs the qualified form when the meaning differs.
Common Compilation/Runtime Mistakes & Version Gotchas
Adding a use for a type when a trait is needed. use crate::Uuid; imports the type; use crate::ToLowercase; or the prelude import is what makes the method resolve.
Ignoring the help: lines. They usually say exactly which trait to import or which receiver type has the method, and they are generated from the compiler's own candidate list.
Blaming the code when the lockfile changed. Cargo.lock committed in a binary crate keeps versions stable; a library crate without one can resolve differently on every machine, which is the usual reason CI fails and a laptop does not.
Using #[allow(unused_imports)] to keep a trait import. The import is required for the method call, so a use that appears unused may be needed by another file through a macro expansion. Check cargo check before removing it.
Forcing a version with a wildcard. cargo update -p chrono --precise 0.4 is not a valid version, and 0.4.* in a patch is rejected; use an exact version or a range.
Version notes. -Z minimal-versions and the 2024 edition resolver changes affect which duplicate versions can coexist, but the method-resolution rule is unchanged. cargo tree -d omits duplicates that differ only by patch level in some older versions, so cargo tree --duplicates is the explicit form. Rust 2024 makes use of a trait inside a block scope subject to the same rules, so a trait imported in a function is not available in a nested module.
Order: read the help: block, import the named trait, then check cargo tree -d if the type comes from another crate. When two versions are the cause, the text diff on Cargo.lock shows the version that moved, and the regex tester is a quick way to list impl ... for blocks across a source tree.
Official references: E0599 and Cargo resolver.
Official references
primary documentationThe Rust documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit Rust work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Rust guides
All Rust guidesRust: failed to run custom build command for openssl-sys
The build script could not find OpenSSL headers. Read its output, install the development package, point pkg-config at the prefix, or vendor the library.
Cargo: failed to select a version for a requirement
Candidates exist but none match, or two requirements cannot unify. Read the graph before touching Cargo.lock.
Rust 1.90 moved to rust-lld and linking started failing
A linker swap broke the build without a code change. Here is why lld misses /usr/local/lib and how to choose between fixing and opting out.
Rust 2024 edition: static mut references and if-let drop order
Edition 2024 denies shared references to static mut and drops if-let temporaries earlier. Both are silent until the build or a deadlock changes.
More in Rust
All Rust guidesThe guides filed next to this one in Rust, in library order.