summaryrefslogtreecommitdiff
path: root/tests/src/loops-borrow-check-fail.rs
diff options
context:
space:
mode:
authorSon HO2024-06-06 09:15:22 +0200
committerGitHub2024-06-06 09:15:22 +0200
commit961cc880311aed3319b08755c5a43816e2490d7f (patch)
tree80cc3d5db32d7198adbdf89e516484dc01e58186 /tests/src/loops-borrow-check-fail.rs
parentbaa0771885546816461e063131162b94c6954d86 (diff)
parenta4dd9fe0598328976862868097f59207846d865c (diff)
Merge pull request #233 from AeneasVerif/son/borrow-check
Add a `-borrow-check` option
Diffstat (limited to 'tests/src/loops-borrow-check-fail.rs')
-rw-r--r--tests/src/loops-borrow-check-fail.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/src/loops-borrow-check-fail.rs b/tests/src/loops-borrow-check-fail.rs
new file mode 100644
index 00000000..24be052c
--- /dev/null
+++ b/tests/src/loops-borrow-check-fail.rs
@@ -0,0 +1,21 @@
+//@ [!borrow-check] skip
+//@ [borrow-check] known-failure
+
+// We need to use the general rules for joining the loans
+fn loop_reborrow_mut() {
+ let mut x = 0;
+ let mut px = &mut x;
+ while *px > 0 {
+ x += 1;
+ px = &mut x;
+ }
+}
+
+// We need to imrpove [prepare_ashared_loans]
+fn iter_local_shared_borrow() {
+ let mut x = 0;
+ let mut p = &x;
+ loop {
+ p = &(*p);
+ }
+}