Error map

E0502 Rust: error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable

Rust · layer 4, Application & API

Open the full error page →

Centre: this error. First ring: errors it is linked with (9). Outer ring: what those are linked with. Colours show the layer of a request each error belongs to. Click any dot to re-centre the map on it; hover to follow its connections. The centre dot opens the error page.

E0502 — Rust: error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable (Rust)E0502Cannot access a disposed context instance — ObjectDisposedException: Cannot access a disposed context instance (.NET)Cannot access a dis…E0382 — Rust: error[E0382]: borrow of moved value: `x` (Rust)E0382E0308 — Rust: error[E0308]: mismatched types — expected `X`, found `Y` (Rust)E0308E0499: cannot borrow as mutable more than once at a time — Rust: error[E0499]: cannot borrow `v` as mutable more than once at a time (Rust)E0499: cannot borro…E0596: cannot borrow as mutable, as it is not declared as mutable — Rust: error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable (Rust)E0596: cannot borro…E0106: missing lifetime specifier — Rust: error[E0106]: missing lifetime specifier — this function's return type contains a borrowed value, but the signature does not say which one of `x`'s 2 lifetimes it is borrowed from (Rust)E0106: missing life…E0597: borrowed value does not live long enough — Rust: error[E0597]: `x` does not live long enough — borrowed value does not live long enough (Rust)E0597: borrowed val…E0384: cannot assign twice to immutable variable — Rust: error[E0384]: cannot assign twice to immutable variable `x` (Rust)E0384: cannot assig…E0521: borrowed data escapes outside of function — Rust: error[E0521]: borrowed data escapes outside of function — `data` escapes the function body here (tokio::spawn requires 'static) (Rust)E0521: borrowed dat…InvalidOperationException — InvalidOperationException: Unable to resolve service for type 'X' while attempting to activate 'Y' (.NET)InvalidOperationExc…JsonException object cycle — JsonException: A possible object cycle was detected (.NET)JsonException objec…No database provider has been configured — InvalidOperationException: No database provider has been configured for this DbContext (.NET)No database provide…E0505: cannot move out of value because it is borrowed — Rust: error[E0505]: cannot move out of `s` because it is borrowed (Rust)E0505: cannot move …E0507: cannot move out of a shared reference / index — Rust: error[E0507]: cannot move out of `self.name` which is behind a shared reference (Rust)E0507: cannot move …AttributeError — AttributeError: 'X' object has no attribute 'y' (Python)AttributeErrorClassCastException — java.lang.ClassCastException: class A cannot be cast to class B (Java)ClassCastExceptionTS7016 — TS7016: Could not find a declaration file for module 'x'. 'x.js' implicitly has an 'any' type. (Node.js)TS7016panic: already borrowed: BorrowMutError — Rust: thread 'main' panicked at src/main.rs:8:9: already borrowed: BorrowMutError / already mutably borrowed: BorrowError (Rust)panic: already borr…cargo: failed to get from registry (spurious network error) — Cargo: warning: spurious network error (2 tries remaining): [35] SSL connect error / error: failed to download from `https://index.crates.io/...` (Rust)cargo: failed to ge…Blocking waiting for file lock on package cache / build directory — Cargo: Blocking waiting for file lock on package cache / on build directory (Rust)Blocking waiting fo…E0373: closure may outlive the current function — Rust: error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function (Rust)E0373: closure may …E0716: temporary value dropped while borrowed — Rust: error[E0716]: temporary value dropped while borrowed — creates a temporary value which is freed while still in use (Rust)E0716: temporary va…cargo: failed to select a version for the requirement — Cargo: error: failed to select a version for the requirement `serde = "^2.0"` — candidate versions found which didn't match: 1.0.197 (Rust)cargo: failed to se…E0381: used binding isn't initialized — Rust: error[E0381]: used binding `x` is possibly-uninitialized (Rust)E0381: used binding…feature edition2024 is required / Cargo.lock version too new — Cargo: error: failed to parse manifest — feature `edition2024` is required / lock file version 4 requires `-Znext-lockfile-bump` (Rust)feature edition2024…E0728: await is only allowed inside async functions and blocks — Rust: error[E0728]: `await` is only allowed inside `async` functions and blocks (Rust)E0728: await is onl…E0752: main function is not allowed to be async — Rust: error[E0752]: `main` function is not allowed to be `async` (Rust)E0752: main functio…Cannot start a runtime from within a runtime (Tokio) — Rust: thread 'main' panicked: Cannot start a runtime from within a runtime — a function like `block_on` tried to block a thread that drives async tasks (Rust)Cannot start a runt…

Directly related (9)

Cannot access a disposed context instance.NET

ObjectDisposedException: Cannot access a disposed context instance

Code used a DbContext after its scope ended — usually async void, fire-and-forget tasks, or capturing a scoped context in a singl…

E0382Rust

Rust: error[E0382]: borrow of moved value: `x`

A value was moved (ownership transferred) and then used again.

E0308Rust

Rust: error[E0308]: mismatched types — expected `X`, found `Y`

A value’s type doesn’t match what the context expects — common with &str vs String, Option/Result vs plain values, and integer ty…

E0499: cannot borrow as mutable more than once at a timeRust

Rust: error[E0499]: cannot borrow `v` as mutable more than once at a time

Two mutable references to the same value were alive at once, which Rust forbids.

E0596: cannot borrow as mutable, as it is not declared as mutableRust

Rust: error[E0596]: cannot borrow `v` as mutable, as it is not declared as mutable

You called a `&mut` method (or took `&mut`) on a binding/reference that isn't mutable.

E0106: missing lifetime specifierRust

Rust: error[E0106]: missing lifetime specifier — this function's return type contains a borrowed value, but the signature does not say which one of `x`'s 2 lifetimes it is borrowed from

The compiler can't infer which input reference the returned/stored reference is tied to.

E0597: borrowed value does not live long enoughRust

Rust: error[E0597]: `x` does not live long enough — borrowed value does not live long enough

A reference outlives the value it points to (the value is dropped first).

E0384: cannot assign twice to immutable variableRust

Rust: error[E0384]: cannot assign twice to immutable variable `x`

You reassigned a variable declared without `mut`.

E0521: borrowed data escapes outside of functionRust

Rust: error[E0521]: borrowed data escapes outside of function — `data` escapes the function body here (tokio::spawn requires 'static)

A reference was passed to something requiring `'static` (spawn tasks/threads) but it borrows local data.

Two steps away (19)

InvalidOperationException.NET

InvalidOperationException: Unable to resolve service for type 'X' while attempting to activate 'Y'

ASP.NET Core’s dependency injection container can’t build Y because one of its constructor dependencies (X) was never registered.

JsonException object cycle.NET

JsonException: A possible object cycle was detected

System.Text.Json found a reference loop (e.g. Order → Customer → Orders → …) while serialising, usually from EF Core navigation p…

No database provider has been configured.NET

InvalidOperationException: No database provider has been configured for this DbContext

EF Core created a DbContext without UseSqlServer/UseNpgsql/UseSqlite — typically because the context was newed up manually or reg…

E0505: cannot move out of value because it is borrowedRust

Rust: error[E0505]: cannot move out of `s` because it is borrowed

You moved a value while a reference to it was still in use.

E0507: cannot move out of a shared reference / indexRust

Rust: error[E0507]: cannot move out of `self.name` which is behind a shared reference

You tried to take ownership of a value through a reference (or from a Vec/Option behind `&`).

AttributeErrorPython

AttributeError: 'X' object has no attribute 'y'

You accessed an attribute or method that doesn’t exist on that object type.

ClassCastExceptionJava

java.lang.ClassCastException: class A cannot be cast to class B

An object was cast to a type it isn’t.

TS7016Node.js

TS7016: Could not find a declaration file for module 'x'. 'x.js' implicitly has an 'any' type.

The JavaScript package has no TypeScript types bundled and no @types package installed.

panic: already borrowed: BorrowMutErrorRust

Rust: thread 'main' panicked at src/main.rs:8:9: already borrowed: BorrowMutError / already mutably borrowed: BorrowError

A `RefCell` was borrowed in conflicting ways at runtime (a mutable borrow while another borrow was alive).

cargo: failed to get from registry (spurious network error)Rust

Cargo: warning: spurious network error (2 tries remaining): [35] SSL connect error / error: failed to download from `https://index.crates.io/...`

Cargo couldn't reach crates.io (network, proxy, TLS or DNS issues).

Blocking waiting for file lock on package cache / build directoryRust

Cargo: Blocking waiting for file lock on package cache / on build directory

Another cargo process (or rust-analyzer/IDE) holds the lock, so this command waits.

E0373: closure may outlive the current functionRust

Rust: error[E0373]: closure may outlive the current function, but it borrows `v`, which is owned by the current function

A closure borrowing a local is passed somewhere that may outlive it (thread::spawn, tokio::spawn, returned closures).

E0716: temporary value dropped while borrowedRust

Rust: error[E0716]: temporary value dropped while borrowed — creates a temporary value which is freed while still in use

A reference points to a temporary that's dropped at the end of the statement.

cargo: failed to select a version for the requirementRust

Cargo: error: failed to select a version for the requirement `serde = "^2.0"` — candidate versions found which didn't match: 1.0.197

Cargo can't find a version of a dependency satisfying the constraints you (or other crates) set.

E0381: used binding isn't initializedRust

Rust: error[E0381]: used binding `x` is possibly-uninitialized

A variable might be read before every code path assigned it.

feature edition2024 is required / Cargo.lock version too newRust

Cargo: error: failed to parse manifest — feature `edition2024` is required / lock file version 4 requires `-Znext-lockfile-bump`

Your Cargo is older than the manifest or lockfile requires.

E0728: await is only allowed inside async functions and blocksRust

Rust: error[E0728]: `await` is only allowed inside `async` functions and blocks

You used `.await` in a normal (sync) function or closure.

E0752: main function is not allowed to be asyncRust

Rust: error[E0752]: `main` function is not allowed to be `async`

`async fn main()` needs a runtime attribute (Tokio/async-std), the std `main` can't be async.

Cannot start a runtime from within a runtime (Tokio)Rust

Rust: thread 'main' panicked: Cannot start a runtime from within a runtime — a function like `block_on` tried to block a thread that drives async tasks

Blocking code (`block_on`, `reqwest::blocking`) was called inside an async context.