diff options
Diffstat (limited to 'tests/ui/nll/return_from_loop.stderr')
-rw-r--r-- | tests/ui/nll/return_from_loop.stderr | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/nll/return_from_loop.stderr b/tests/ui/nll/return_from_loop.stderr new file mode 100644 index 000000000..bd2b8b158 --- /dev/null +++ b/tests/ui/nll/return_from_loop.stderr @@ -0,0 +1,15 @@ +error[E0499]: cannot borrow `my_struct.field` as mutable more than once at a time + --> $DIR/return_from_loop.rs:20:9 + | +LL | let value = &mut my_struct.field; + | -------------------- first mutable borrow occurs here +LL | loop { +LL | my_struct.field.push_str("Hello, world!"); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second mutable borrow occurs here +LL | +LL | value.len(); + | ----------- first borrow later used here + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0499`. |