Skip to content
Select theme

Compiler errors

Every page here takes one compiler error and answers the only questions that matter: what does the compiler actually mean, why did this code trigger it, and what are the ways to fix it. The output shown is the real thing, copied from rustc, including the compiler’s own suggestion.

If you arrived from a search result, you are in the right place.

Coming up (17)
  • How to fix error E0614: type cannot be dereferencedone * too many, or one too few
  • How to fix error E0658: use of unstable featurenightly, or a different way to write it
  • How to fix error E0765: unstable library featuresame answer, different origin
  • How to fix error E0463: can’t find cratethe dependency is missing, or the target is not installed
  • How to fix error E0004: non-exhaustive patterns in a matchthe arm you forgot, and the catch-all you should not want
  • How to fix error E0061: this function takes N arguments but M were suppliedthe argument you forgot, usually self
  • How to fix “closure may outlive the current function”borrow or move, decided by intent
  • How to fix “cannot move a value into an async block”what move onto an async block actually captures
  • How to fix “recursive type has infinite size”Box, Rc, or a Vec to break the cycle
  • How to fix “the size for values of type X cannot be known at compilation time”Sized, and why it is everywhere
  • How to fix “cannot return value referencing local variable”return the owned value instead
  • How to fix “cannot move out of X, which is behind a shared reference”clone, take, or Copy
  • How to fix “borrowed data escapes outside of closure”the closure outlives the borrow
  • How to fix “overflow evaluating the requirement”recursive trait bounds and how to stop them
  • How to fix “cannot infer type for type parameter”the annotation goes on the call, not the function
  • How to fix “mismatched types: expected (), found i32”the missing semicolon, and the missing return
  • How to fix “requires that X is borrowed for ’static”owned data, or a leak you meant to make