diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr (renamed from src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr) | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr index 6b43801b5..48b42bc78 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr +++ b/tests/ui/span/borrowck-call-is-borrow-issue-12224.stderr @@ -13,18 +13,24 @@ LL | f((Box::new(|| {}))) error[E0596]: cannot borrow `*f` as mutable, as it is behind a `&` reference --> $DIR/borrowck-call-is-borrow-issue-12224.rs:25:5 | -LL | fn test2<F>(f: &F) where F: FnMut() { - | -- help: consider changing this to be a mutable reference: `&mut F` LL | (*f)(); | ^^^^ `f` is a `&` reference, so the data it refers to cannot be borrowed as mutable + | +help: consider changing this to be a mutable reference + | +LL | fn test2<F>(f: &mut F) where F: FnMut() { + | ~~~~~~ error[E0596]: cannot borrow `f.f` as mutable, as it is behind a `&` reference --> $DIR/borrowck-call-is-borrow-issue-12224.rs:34:5 | -LL | fn test4(f: &Test) { - | ----- help: consider changing this to be a mutable reference: `&mut Test<'_>` LL | f.f.call_mut(()) | ^^^^^^^^^^^^^^^^ `f` is a `&` reference, so the data it refers to cannot be borrowed as mutable + | +help: consider changing this to be a mutable reference + | +LL | fn test4(f: &mut Test<'_>) { + | ~~~~~~~~~~~~~ error[E0507]: cannot move out of `f`, a captured variable in an `FnMut` closure --> $DIR/borrowck-call-is-borrow-issue-12224.rs:57:13 |