]> git.proxmox.com Git - rustc.git/blame - tests/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.stderr
New upstream version 1.71.1+dfsg1
[rustc.git] / tests / ui / trivial-bounds / trivial-bounds-inconsistent-copy-reborrow.stderr
CommitLineData
48663c56 1error[E0596]: cannot borrow `**t` as mutable, as it is behind a `&` reference
0731742a 2 --> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:6:5
94b46f34 3 |
532ac7d7 4LL | *t
48663c56 5 | ^^ `t` is a `&` reference, so the data it refers to cannot be borrowed as mutable
9c376795
FG
6 |
7help: consider changing this to be a mutable reference
8 |
9LL | fn reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
49aad941 10 | +++
94b46f34 11
48663c56 12error[E0596]: cannot borrow `**t` as mutable, as it is behind a `&` reference
0731742a 13 --> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:10:6
94b46f34 14 |
532ac7d7 15LL | {*t}
48663c56 16 | ^^ `t` is a `&` reference, so the data it refers to cannot be borrowed as mutable
9c376795
FG
17 |
18help: consider changing this to be a mutable reference
19 |
20LL | fn copy_reborrow_mut<'a>(t: &'a mut &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
49aad941 21 | +++
94b46f34
XL
22
23error: aborting due to 2 previous errors
24
48663c56 25For more information about this error, try `rustc --explain E0596`.