]> git.lizzy.rs Git - rust.git/blob - src/test/ui/trivial-bounds-inconsistent-copy-reborrow.stderr
Add tests for trivial bounds
[rust.git] / src / test / ui / trivial-bounds-inconsistent-copy-reborrow.stderr
1 error[E0389]: cannot borrow data mutably in a `&` reference
2   --> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:16:5
3    |
4 LL | fn reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
5    |                        --------------- use `&'a mut &'a mut i32` here to make mutable
6 LL |     *t //~ ERROR
7    |     ^^ assignment into an immutable reference
8
9 error[E0389]: cannot borrow data mutably in a `&` reference
10   --> $DIR/trivial-bounds-inconsistent-copy-reborrow.rs:20:6
11    |
12 LL | fn copy_reborrow_mut<'a>(t: &'a &'a mut i32) -> &'a mut i32 where &'a mut i32: Copy {
13    |                             --------------- use `&'a mut &'a mut i32` here to make mutable
14 LL |     {*t} //~ ERROR
15    |      ^^ assignment into an immutable reference
16
17 error: aborting due to 2 previous errors
18
19 For more information about this error, try `rustc --explain E0389`.