2019-04-22 02:40:08 -05:00
|
|
|
error[E0382]: use of moved value: `x.b`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:8:10
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | drop(x.b);
|
|
|
|
| --- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | drop(*x.b);
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^^ value used here after move
|
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0382]: use of moved value: `x.b`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:14:10
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let y = A { a: 3, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ---------------- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | drop(*x.b);
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^^ value used here after move
|
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0382]: borrow of moved value: `x.b`
|
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:20:13
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | drop(x.b);
|
|
|
|
| --- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let p = &x.b;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^ value borrowed here after move
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0382]: borrow of moved value: `x.b`
|
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:27:13
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let _y = A { a: 3, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ---------------- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let p = &x.b;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^ value borrowed here after move
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0505]: cannot move out of `x.b` because it is borrowed
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:34:10
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2023-01-16 20:47:50 -06:00
|
|
|
LL | let x = A { a: 1, b: Box::new(2) };
|
|
|
|
| - binding `x` declared here
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | let p = &x.b;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ---- borrow of `x.b` occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | drop(x.b);
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^ move out of `x.b` occurs here
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | drop(**p);
|
|
|
|
| --- borrow later used here
|
2024-03-12 20:51:08 -05:00
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
2024-03-12 21:13:51 -05:00
|
|
|
LL - let p = &x.b;
|
|
|
|
LL + let p = x.b.clone();
|
|
|
|
|
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0505]: cannot move out of `x.b` because it is borrowed
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:41:14
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2023-01-16 20:47:50 -06:00
|
|
|
LL | let x = A { a: 1, b: Box::new(2) };
|
|
|
|
| - binding `x` declared here
|
2018-08-08 07:28:26 -05:00
|
|
|
LL | let p = &x.b;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ---- borrow of `x.b` occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _y = A { a: 3, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^ move out of `x.b` occurs here
|
|
|
|
LL | drop(**p);
|
|
|
|
| --- borrow later used here
|
2024-03-12 20:51:08 -05:00
|
|
|
|
|
|
|
|
help: consider cloning the value if the performance cost is acceptable
|
|
|
|
|
|
2024-03-12 21:13:51 -05:00
|
|
|
LL - let p = &x.b;
|
|
|
|
LL + let p = x.b.clone();
|
|
|
|
|
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0499]: cannot borrow `x.a` as mutable more than once at a time
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:48:13
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let p = &mut x.a;
|
2019-04-22 02:40:08 -05:00
|
|
|
| -------- first mutable borrow occurs here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let q = &mut x.a;
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^ second mutable borrow occurs here
|
|
|
|
LL | drop(*p);
|
|
|
|
| -- first borrow later used here
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `x.b`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:56:10
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | drop(x.b);
|
|
|
|
| --- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | drop(x.b);
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^ value used here after move
|
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `x.b`
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:62:10
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let _y = A { a: 3, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ---------------- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | drop(x.b);
|
2018-08-08 07:28:26 -05:00
|
|
|
| ^^^ value used here after move
|
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `x.b`
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:68:14
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | drop(x.b);
|
|
|
|
| --- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _z = A { a: 3, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^ value used here after move
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error[E0382]: use of moved value: `x.b`
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:74:14
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | let _y = A { a: 3, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ---------------- value moved here
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | let _z = A { a: 4, .. x };
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^ value used here after move
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: partially assigned binding `x` isn't fully initialized
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:81:5
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let mut x: A;
|
2022-06-21 17:54:17 -05:00
|
|
|
| ----- binding declared here but left uninitialized
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | x.a = 1;
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^^^^^^^ `x` partially assigned here but it isn't fully initialized
|
|
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: partially assigned binding `x` isn't fully initialized
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:87:5
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let mut x: A;
|
2022-06-21 17:54:17 -05:00
|
|
|
| ----- binding declared here but left uninitialized
|
2019-04-22 02:40:08 -05:00
|
|
|
LL | x.a = 1;
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^^^^^^^ `x` partially assigned here but it isn't fully initialized
|
|
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
error[E0381]: partially assigned binding `x` isn't fully initialized
|
2019-04-22 02:40:08 -05:00
|
|
|
--> $DIR/borrowck-field-sensitivity.rs:94:5
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
2022-06-21 13:57:45 -05:00
|
|
|
LL | let mut x: A;
|
2022-06-21 17:54:17 -05:00
|
|
|
| ----- binding declared here but left uninitialized
|
2021-08-24 19:39:40 -05:00
|
|
|
LL | x.b = Box::new(1);
|
2022-06-21 13:57:45 -05:00
|
|
|
| ^^^ `x` partially assigned here but it isn't fully initialized
|
|
|
|
|
|
2022-06-21 17:54:17 -05:00
|
|
|
= help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit`
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
error: aborting due to 14 previous errors
|
|
|
|
|
2019-04-17 12:26:38 -05:00
|
|
|
Some errors have detailed explanations: E0381, E0382, E0499, E0505.
|
2018-08-08 07:28:26 -05:00
|
|
|
For more information about an error, try `rustc --explain E0381`.
|