]> git.lizzy.rs Git - rust.git/blob - src/test/ui/trivial-bounds/trivial-bounds-inconsistent-copy-reborrow.nll.stderr
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / trivial-bounds / trivial-bounds-inconsistent-copy-reborrow.nll.stderr
1 error[E0596]: cannot borrow `**t` as mutable, as it is behind a `&` reference
2   --> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:6:5
3    |
4 LL | fn reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
5    |                        --------------- help: consider changing this to be a mutable reference: `&'a mut &'a mut i32`
6 LL |     *t //~ ERROR
7    |     ^^ `t` is a `&` reference, so the data it refers to cannot be borrowed as mutable
8
9 error[E0596]: cannot borrow `**t` as mutable, as it is behind a `&` reference
10   --> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:10:6
11    |
12 LL | fn copy_reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
13    |                             --------------- help: consider changing this to be a mutable reference: `&'a mut &'a mut i32`
14 LL |     {*t} //~ ERROR
15    |      ^^ `t` is a `&` reference, so the data it refers to cannot be borrowed as mutable
16
17 error: aborting due to 2 previous errors
18
19 For more information about this error, try `rustc --explain E0596`.