Content-Length: 12795 | pFad | https://doc.rust-lang.org/std/pin/../default/../rc/../../../std/../error_codes/././E0596.html

E0596 - 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 E0596

This error occurs because you tried to mutably borrow a non-mutable variable.

Erroneous code example:

#![allow(unused)]
fn main() {
let x = 1;
let y = &mut x; // error: cannot borrow mutably
}

In here, x isn't mutable, so when we try to mutably borrow it in y, it fails. To fix this error, you need to make x mutable:

#![allow(unused)]
fn main() {
let mut x = 1;
let y = &mut x; // ok!
}








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/../default/../rc/../../../std/../error_codes/././E0596.html

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy