Email me

Rust errors · 518 codes · checked with rustc 1.99.0

Rust compiler errors, explained with fixes

Paste the error from your terminal and jump straight to what it means and how to fix it. Every code rustc knows, with the real message it prints today.

518error codes in rustc 1.99.0
388still emitted today
362with the real message we compiled
43with step-by-step fixes

The ones people hit most

E0382borrow of moved valueYou used a variable after giving it away. A non-Copy value (String, Vec, a struct) has one owner; passing it by value to...E0499cannot borrow as mutable more than once at a timeTwo &mut references to the same thing are alive at the same time. Rust allows one mutable borrow at a time so no two...E0502cannot borrow as mutable because it is also borrowed as immutableYou are changing something while a shared reference to it is still in use. A shared & borrow promises the data will ...E0308mismatched typesA value has a different type from the one the code around it needs. The message says which type was expected and which o...E0277the trait bound is not satisfiedA type is used somewhere that needs a trait it does not implement. Printing needs Display or Debug, threads need Send, ?...E0106missing lifetime specifierA reference in a struct field or a return type needs a lifetime, and Rust cannot work out which input it borrows from....E0425cannot find value in this scopeA name is used that does not exist where it is used: a typo, a variable from another scope, a missing import, or self ou...E0599no method named X found in the current scopeThe method does not exist on that type, or it comes from a trait that is not imported, or its trait bounds are not met....E0433failed to resolveA path does not resolve: a type, module or crate is used without being imported or declared....E0597does not live long enoughA reference outlives the value it points to. The value is dropped at the end of its scope while something still holds a ...E0716temporary value dropped while borrowedYou borrowed from a temporary (a value that only lives for one statement) and kept the borrow. Bind the temporary to a v...E0507cannot move out ofYou tried to take ownership of a value you only have a reference to. Through a & you can read, copy or clone, but no...

Browse by kind of problem

Ownership and borrowing (56)

Types and traits (166)

Names, paths and imports (49)

Patterns and matching (15)

Const, static and compile-time (10)

Attributes, macros and features (31)

Everything else (191)

How we built this

We ran rustc --explain for every code from E0001 to E0899 on rustc 1.99.0, compiled each official erroneous example with that compiler, and kept the exact first line it printed. The common errors also get our own plain answer, the usual causes and fixes. Explanations are from the Rust project (MIT or Apache-2.0). Greyed codes are retired: rustc no longer emits them.

Up next

Most hitE0382: borrow of moved valueThe error almost every Rust developer meets first.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ