diff options
author | Esteban Küber <esteban@kuber.com.ar> | 2023-01-17 02:45:11 +0000 |
---|---|---|
committer | Esteban Küber <esteban@kuber.com.ar> | 2023-01-17 02:45:11 +0000 |
commit | be2ec32b18f7ad858dc746b26eb3a91a62a2c360 (patch) | |
tree | 179269f8d720b4a4edb46d47706e4af5f41fe3fd /tests/ui/borrowck | |
parent | e4f61afa779e01af24c6f20394de8e3950b368c2 (diff) | |
download | rust-be2ec32b18f7ad858dc746b26eb3a91a62a2c360.tar.gz |
Account for `*` when looking for inner-most path in expression
Diffstat (limited to 'tests/ui/borrowck')
-rw-r--r-- | tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr | 5 | ||||
-rw-r--r-- | tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr | 2 | ||||
-rw-r--r-- | tests/ui/borrowck/borrowck-unary-move.stderr | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr b/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr index 371bcf2b69c..e582ec605de 100644 --- a/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr +++ b/tests/ui/borrowck/borrowck-bad-nested-calls-move.stderr @@ -1,6 +1,9 @@ error[E0505]: cannot move out of `a` because it is borrowed --> $DIR/borrowck-bad-nested-calls-move.rs:25:9 | +LL | let mut a: Box<_> = Box::new(1); + | ----- binding `a` declared here +... LL | add( | --- borrow later used by call LL | &*a, @@ -11,6 +14,8 @@ LL | a); error[E0505]: cannot move out of `a` because it is borrowed --> $DIR/borrowck-bad-nested-calls-move.rs:32:9 | +LL | let mut a: Box<_> = Box::new(1); + | ----- binding `a` declared here LL | add( | --- borrow later used by call LL | &*a, diff --git a/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr b/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr index d5ff0c501c4..cdad20c52bf 100644 --- a/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr +++ b/tests/ui/borrowck/borrowck-move-mut-base-ptr.stderr @@ -1,6 +1,8 @@ error[E0505]: cannot move out of `t0` because it is borrowed --> $DIR/borrowck-move-mut-base-ptr.rs:10:14 | +LL | fn foo(t0: &mut isize) { + | -- binding `t0` declared here LL | let p: &isize = &*t0; // Freezes `*t0` | ---- borrow of `*t0` occurs here LL | let t1 = t0; diff --git a/tests/ui/borrowck/borrowck-unary-move.stderr b/tests/ui/borrowck/borrowck-unary-move.stderr index aab225ed4a4..f3b962059f5 100644 --- a/tests/ui/borrowck/borrowck-unary-move.stderr +++ b/tests/ui/borrowck/borrowck-unary-move.stderr @@ -1,6 +1,8 @@ error[E0505]: cannot move out of `x` because it is borrowed --> $DIR/borrowck-unary-move.rs:3:10 | +LL | fn foo(x: Box<isize>) -> isize { + | - binding `x` declared here LL | let y = &*x; | --- borrow of `*x` occurs here LL | free(x); |