]> git.proxmox.com Git - rustc.git/blob - src/doc/book/listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt
New upstream version 1.43.0+dfsg1
[rustc.git] / src / doc / book / listings / ch15-smart-pointers / no-listing-01-cant-borrow-immutable-as-mutable / output.txt
1 $ cargo run
2 Compiling borrowing v0.1.0 (file:///projects/borrowing)
3 error[E0596]: cannot borrow `x` as mutable, as it is not declared as mutable
4 --> src/main.rs:3:13
5 |
6 2 | let x = 5;
7 | - help: consider changing this to be mutable: `mut x`
8 3 | let y = &mut x;
9 | ^^^^^^ cannot borrow as mutable
10
11 error: aborting due to previous error
12
13 For more information about this error, try `rustc --explain E0596`.
14 error: could not compile `borrowing`.
15
16 To learn more, run the command again with --verbose.