diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr')
-rw-r--r-- | src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr | 87 |
1 files changed, 0 insertions, 87 deletions
diff --git a/src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr b/src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr deleted file mode 100644 index a0eaf1f16..000000000 --- a/src/test/ui/borrowck/borrow-immutable-upvar-mutation.stderr +++ /dev/null @@ -1,87 +0,0 @@ -error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:21:27 - | -LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F { - | - change this to accept `FnMut` instead of `Fn` -... -LL | let _f = to_fn(|| x = 42); - | ----- -- ^^^^^^ cannot assign - | | | - | | in this closure - | expects `Fn` instead of `FnMut` - -error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:24:31 - | -LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F { - | - change this to accept `FnMut` instead of `Fn` -... -LL | let _g = to_fn(|| set(&mut y)); - | ----- -- ^^^^^^ cannot borrow as mutable - | | | - | | in this closure - | expects `Fn` instead of `FnMut` - -error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:29:22 - | -LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F { - | - change this to accept `FnMut` instead of `Fn` -... -LL | to_fn(|| z = 42); - | ----- -- ^^^^^^ cannot assign - | | | - | | in this closure - | expects `Fn` instead of `FnMut` - -error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:36:32 - | -LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F { - | - change this to accept `FnMut` instead of `Fn` -... -LL | let _f = to_fn(move || x = 42); - | ----- ------- ^^^^^^ cannot assign - | | | - | | in this closure - | expects `Fn` instead of `FnMut` - -error[E0596]: cannot borrow `y` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:39:36 - | -LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F { - | - change this to accept `FnMut` instead of `Fn` -... -LL | let _g = to_fn(move || set(&mut y)); - | ----- ------- ^^^^^^ cannot borrow as mutable - | | | - | | in this closure - | expects `Fn` instead of `FnMut` - -error[E0594]: cannot assign to `z`, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:44:27 - | -LL | fn to_fn<A: std::marker::Tuple, F: Fn<A>>(f: F) -> F { - | - change this to accept `FnMut` instead of `Fn` -... -LL | to_fn(move || z = 42); - | ----- ------- ^^^^^^ cannot assign - | | | - | | in this closure - | expects `Fn` instead of `FnMut` - -error[E0594]: cannot assign to `x`, as it is a captured variable in a `Fn` closure - --> $DIR/borrow-immutable-upvar-mutation.rs:53:9 - | -LL | fn foo() -> Box<dyn Fn() -> usize> { - | --- ---------------------- change this to return `FnMut` instead of `Fn` -LL | let mut x = 0; -LL | Box::new(move || { - | ------- in this closure -LL | x += 1; - | ^^^^^^ cannot assign - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0594, E0596. -For more information about an error, try `rustc --explain E0594`. |