diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/borrowck/borrowck-use-mut-borrow.stderr | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/borrowck/borrowck-use-mut-borrow.stderr')
-rw-r--r-- | src/test/ui/borrowck/borrowck-use-mut-borrow.stderr | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/borrowck-use-mut-borrow.stderr b/src/test/ui/borrowck/borrowck-use-mut-borrow.stderr new file mode 100644 index 000000000..91d69c51e --- /dev/null +++ b/src/test/ui/borrowck/borrowck-use-mut-borrow.stderr @@ -0,0 +1,95 @@ +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:11:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(x); + | ^ use of borrowed `x` +LL | *p = 2; + | ------ borrow later used here + +error[E0503]: cannot use `x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:18:10 + | +LL | let p = &mut x.a; + | -------- borrow of `x.a` occurs here +LL | drop(x); + | ^ use of borrowed `x.a` +LL | *p = 3; + | ------ borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:25:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(x.a); + | ^^^ use of borrowed `x` +LL | p.a = 3; + | ------- borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:32:10 + | +LL | let p = &mut x.a; + | -------- borrow of `x.a` occurs here +LL | drop(x.a); + | ^^^ use of borrowed `x.a` +LL | *p = 3; + | ------ borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:39:13 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | let y = A { b: 3, .. x }; + | ^^^^^^^^^^^^^^^^ use of borrowed `x` +LL | drop(y); +LL | p.a = 4; + | ------- borrow later used here + +error[E0503]: cannot use `x.a` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:47:13 + | +LL | let p = &mut x.a; + | -------- borrow of `x.a` occurs here +LL | let y = A { b: 3, .. x }; + | ^^^^^^^^^^^^^^^^ use of borrowed `x.a` +LL | drop(y); +LL | *p = 4; + | ------ borrow later used here + +error[E0503]: cannot use `*x` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:55:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(*x); + | ^^ use of borrowed `x` +LL | **p = 2; + | ------- borrow later used here + +error[E0503]: cannot use `*x.b` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:62:10 + | +LL | let p = &mut x; + | ------ borrow of `x` occurs here +LL | drop(*x.b); + | ^^^^ use of borrowed `x` +LL | p.a = 3; + | ------- borrow later used here + +error[E0503]: cannot use `*x.b` because it was mutably borrowed + --> $DIR/borrowck-use-mut-borrow.rs:69:10 + | +LL | let p = &mut x.b; + | -------- borrow of `x.b` occurs here +LL | drop(*x.b); + | ^^^^ use of borrowed `x.b` +LL | **p = 3; + | ------- borrow later used here + +error: aborting due to 9 previous errors + +For more information about this error, try `rustc --explain E0503`. |