Content-Length: 24189 | pFad | https://doc.rust-lang.org/std/pin/../cmp/../fs/../iter/../../../std/../../error_codes/./E0595.html

E0595 - Error codes index

Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Error code E0595

Note: this error code is no longer emitted by the compiler.

Closures cannot mutate immutable captured variables.

Erroneous code example:

#![allow(unused)]
fn main() {
let x = 3; // error: closure cannot assign to immutable local variable `x`
let mut c = || { x += 1 };
}

Make the variable binding mutable:

#![allow(unused)]
fn main() {
let mut x = 3; // ok!
let mut c = || { x += 1 };
}








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://doc.rust-lang.org/std/pin/../cmp/../fs/../iter/../../../std/../../error_codes/./E0595.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy