summaryrefslogtreecommitdiffstats
path: root/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
parentInitial commit. (diff)
downloadrustc-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/two-phase-surprise-no-conflict.stderr')
-rw-r--r--src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr161
1 files changed, 161 insertions, 0 deletions
diff --git a/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr b/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
new file mode 100644
index 000000000..5a240d900
--- /dev/null
+++ b/src/test/ui/borrowck/two-phase-surprise-no-conflict.stderr
@@ -0,0 +1,161 @@
+error[E0503]: cannot use `self.cx` because it was mutably borrowed
+ --> $DIR/two-phase-surprise-no-conflict.rs:21:23
+ |
+LL | let _mut_borrow = &mut *self;
+ | ---------- borrow of `*self` occurs here
+LL | let _access = self.cx;
+ | ^^^^^^^ use of borrowed `*self`
+LL |
+LL | _mut_borrow;
+ | ----------- borrow later used here
+
+error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
+ --> $DIR/two-phase-surprise-no-conflict.rs:57:17
+ |
+LL | self.hash_expr(&self.cx_mut.body(eid).value);
+ | ^^^^^---------^^---------------------^^^^^^^
+ | | | |
+ | | | immutable borrow occurs here
+ | | immutable borrow later used by call
+ | mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:119:51
+ |
+LL | reg.register_static(Box::new(TrivialPass::new(&mut reg.sess_mut)));
+ | ----------------------------------------------^^^^^^^^^^^^^^^^^---
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:122:54
+ |
+LL | reg.register_bound(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
+ | -------------------------------------------------^^^^^^^^^^^^^^^^^---
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:125:53
+ |
+LL | reg.register_univ(Box::new(TrivialPass::new_mut(&mut reg.sess_mut)));
+ | ------------------------------------------------^^^^^^^^^^^^^^^^^---
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:128:44
+ |
+LL | reg.register_ref(&TrivialPass::new_mut(&mut reg.sess_mut));
+ | ---------------------------------------^^^^^^^^^^^^^^^^^--
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
+ --> $DIR/two-phase-surprise-no-conflict.rs:138:5
+ |
+LL | reg.register_bound(Box::new(CapturePass::new(&reg.sess_mut)));
+ | ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^^^
+ | | | |
+ | | | immutable borrow occurs here
+ | | immutable borrow later used by call
+ | mutable borrow occurs here
+
+error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
+ --> $DIR/two-phase-surprise-no-conflict.rs:141:5
+ |
+LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
+ | -- lifetime `'a` defined here
+...
+LL | reg.register_univ(Box::new(CapturePass::new(&reg.sess_mut)));
+ | ^^^^^^^^^^^^^^^^^^-----------------------------------------^
+ | | | |
+ | | | immutable borrow occurs here
+ | | cast requires that `reg.sess_mut` is borrowed for `'a`
+ | mutable borrow occurs here
+
+error[E0502]: cannot borrow `*reg` as mutable because it is also borrowed as immutable
+ --> $DIR/two-phase-surprise-no-conflict.rs:144:5
+ |
+LL | reg.register_ref(&CapturePass::new(&reg.sess_mut));
+ | ^^^^------------^^^^^^^^^^^^^^^^^^^-------------^^
+ | | | |
+ | | | immutable borrow occurs here
+ | | immutable borrow later used by call
+ | mutable borrow occurs here
+
+error[E0499]: cannot borrow `*reg` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:154:5
+ |
+LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
+ | ^^^^--------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------------^^^
+ | | | |
+ | | | first mutable borrow occurs here
+ | | first borrow later used by call
+ | second mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:154:54
+ |
+LL | reg.register_bound(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
+ | -------------------------------------------------^^^^^^^^^^^^^^^^^---
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error[E0499]: cannot borrow `*reg` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:158:5
+ |
+LL | fn register_plugins<'a>(mk_reg: impl Fn() -> &'a mut Registry<'a>) {
+ | -- lifetime `'a` defined here
+...
+LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
+ | ^^^^^^^^^^^^^^^^^^-------------------------------------------------^
+ | | | |
+ | | | first mutable borrow occurs here
+ | | cast requires that `reg.sess_mut` is borrowed for `'a`
+ | second mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:158:53
+ |
+LL | reg.register_univ(Box::new(CapturePass::new_mut(&mut reg.sess_mut)));
+ | ------------------------------------------------^^^^^^^^^^^^^^^^^---
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error[E0499]: cannot borrow `*reg` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:162:5
+ |
+LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
+ | ^^^^------------^^^^^^^^^^^^^^^^^^^^^^^-----------------^^
+ | | | |
+ | | | first mutable borrow occurs here
+ | | first borrow later used by call
+ | second mutable borrow occurs here
+
+error[E0499]: cannot borrow `reg.sess_mut` as mutable more than once at a time
+ --> $DIR/two-phase-surprise-no-conflict.rs:162:44
+ |
+LL | reg.register_ref(&CapturePass::new_mut(&mut reg.sess_mut));
+ | ---------------------------------------^^^^^^^^^^^^^^^^^--
+ | | | |
+ | | | second mutable borrow occurs here
+ | | first borrow later used by call
+ | first mutable borrow occurs here
+
+error: aborting due to 15 previous errors
+
+Some errors have detailed explanations: E0499, E0502, E0503.
+For more information about an error, try `rustc --explain E0499`.