2018-10-14 09:12:02 -05:00
|
|
|
error[E0515]: cannot return reference to local variable `x`
|
2018-09-26 14:41:14 -05:00
|
|
|
--> $DIR/polonius-smoke-test.rs:7:5
|
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | &x
|
2018-10-14 09:12:02 -05:00
|
|
|
| ^^ returns a reference to data owned by the current function
|
2018-09-26 14:41:14 -05:00
|
|
|
|
|
|
|
error[E0503]: cannot use `x` because it was mutably borrowed
|
|
|
|
--> $DIR/polonius-smoke-test.rs:13:13
|
|
|
|
|
|
|
|
|
LL | let y = &mut x;
|
|
|
|
| ------ borrow of `x` occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let z = x;
|
2018-09-26 14:41:14 -05:00
|
|
|
| ^ use of borrowed `x`
|
|
|
|
LL | let w = y;
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0505]: cannot move out of `x` because it is borrowed
|
|
|
|
--> $DIR/polonius-smoke-test.rs:19:13
|
|
|
|
|
|
|
|
|
LL | let y = &mut *x;
|
|
|
|
| ------- borrow of `*x` occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let z = x;
|
2018-09-26 14:41:14 -05:00
|
|
|
| ^ move out of `x` occurs here
|
|
|
|
LL | y
|
|
|
|
| - borrow later used here
|
|
|
|
|
|
|
|
error[E0505]: cannot move out of `s` because it is borrowed
|
|
|
|
--> $DIR/polonius-smoke-test.rs:43:5
|
|
|
|
|
|
|
|
|
LL | let r = &mut *s;
|
|
|
|
| ------- borrow of `*s` occurs here
|
|
|
|
LL | let tmp = foo(&r);
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | s;
|
2018-09-26 14:41:14 -05:00
|
|
|
| ^ move out of `s` occurs here
|
|
|
|
LL | tmp;
|
|
|
|
| --- borrow later used here
|
|
|
|
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0503, E0505, E0515.
|
2018-09-26 14:41:14 -05:00
|
|
|
For more information about an error, try `rustc --explain E0503`.
|