fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0382]: use of moved value: `x.b` 2 --> $DIR/borrowck-field-sensitivity.rs:8:10 3 | 4LL | drop(x.b); 5 | --- value moved here 6LL | drop(*x.b); 7 | ^^^^ value used here after move 8 | 9 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 10 11error[E0382]: use of moved value: `x.b` 12 --> $DIR/borrowck-field-sensitivity.rs:14:10 13 | 14LL | let y = A { a: 3, .. x }; 15 | ---------------- value moved here 16LL | drop(*x.b); 17 | ^^^^ value used here after move 18 | 19 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 20 21error[E0382]: borrow of moved value: `x.b` 22 --> $DIR/borrowck-field-sensitivity.rs:20:13 23 | 24LL | drop(x.b); 25 | --- value moved here 26LL | let p = &x.b; 27 | ^^^^ value borrowed here after move 28 | 29 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 30 31error[E0382]: borrow of moved value: `x.b` 32 --> $DIR/borrowck-field-sensitivity.rs:27:13 33 | 34LL | let _y = A { a: 3, .. x }; 35 | ---------------- value moved here 36LL | let p = &x.b; 37 | ^^^^ value borrowed here after move 38 | 39 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 40 41error[E0505]: cannot move out of `x.b` because it is borrowed 42 --> $DIR/borrowck-field-sensitivity.rs:34:10 43 | 44LL | let x = A { a: 1, b: Box::new(2) }; 45 | - binding `x` declared here 46LL | let p = &x.b; 47 | ---- borrow of `x.b` occurs here 48LL | drop(x.b); 49 | ^^^ move out of `x.b` occurs here 50LL | drop(**p); 51 | --- borrow later used here 52 53error[E0505]: cannot move out of `x.b` because it is borrowed 54 --> $DIR/borrowck-field-sensitivity.rs:41:14 55 | 56LL | let x = A { a: 1, b: Box::new(2) }; 57 | - binding `x` declared here 58LL | let p = &x.b; 59 | ---- borrow of `x.b` occurs here 60LL | let _y = A { a: 3, .. x }; 61 | ^^^^^^^^^^^^^^^^ move out of `x.b` occurs here 62LL | drop(**p); 63 | --- borrow later used here 64 65error[E0499]: cannot borrow `x.a` as mutable more than once at a time 66 --> $DIR/borrowck-field-sensitivity.rs:48:13 67 | 68LL | let p = &mut x.a; 69 | -------- first mutable borrow occurs here 70LL | let q = &mut x.a; 71 | ^^^^^^^^ second mutable borrow occurs here 72LL | drop(*p); 73 | -- first borrow later used here 74 75error[E0382]: use of moved value: `x.b` 76 --> $DIR/borrowck-field-sensitivity.rs:56:10 77 | 78LL | drop(x.b); 79 | --- value moved here 80LL | drop(x.b); 81 | ^^^ value used here after move 82 | 83 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 84 85error[E0382]: use of moved value: `x.b` 86 --> $DIR/borrowck-field-sensitivity.rs:62:10 87 | 88LL | let _y = A { a: 3, .. x }; 89 | ---------------- value moved here 90LL | drop(x.b); 91 | ^^^ value used here after move 92 | 93 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 94 95error[E0382]: use of moved value: `x.b` 96 --> $DIR/borrowck-field-sensitivity.rs:68:14 97 | 98LL | drop(x.b); 99 | --- value moved here 100LL | let _z = A { a: 3, .. x }; 101 | ^^^^^^^^^^^^^^^^ value used here after move 102 | 103 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 104 105error[E0382]: use of moved value: `x.b` 106 --> $DIR/borrowck-field-sensitivity.rs:74:14 107 | 108LL | let _y = A { a: 3, .. x }; 109 | ---------------- value moved here 110LL | let _z = A { a: 4, .. x }; 111 | ^^^^^^^^^^^^^^^^ value used here after move 112 | 113 = note: move occurs because `x.b` has type `Box<isize>`, which does not implement the `Copy` trait 114 115error[E0381]: partially assigned binding `x` isn't fully initialized 116 --> $DIR/borrowck-field-sensitivity.rs:81:5 117 | 118LL | let mut x: A; 119 | ----- binding declared here but left uninitialized 120LL | x.a = 1; 121 | ^^^^^^^ `x` partially assigned here but it isn't fully initialized 122 | 123 = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit` 124 125error[E0381]: partially assigned binding `x` isn't fully initialized 126 --> $DIR/borrowck-field-sensitivity.rs:87:5 127 | 128LL | let mut x: A; 129 | ----- binding declared here but left uninitialized 130LL | x.a = 1; 131 | ^^^^^^^ `x` partially assigned here but it isn't fully initialized 132 | 133 = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit` 134 135error[E0381]: partially assigned binding `x` isn't fully initialized 136 --> $DIR/borrowck-field-sensitivity.rs:94:5 137 | 138LL | let mut x: A; 139 | ----- binding declared here but left uninitialized 140LL | x.b = Box::new(1); 141 | ^^^ `x` partially assigned here but it isn't fully initialized 142 | 143 = help: partial initialization isn't supported, fully initialize the binding with a default value and mutate it, or use `std::mem::MaybeUninit` 144 145error: aborting due to 14 previous errors 146 147Some errors have detailed explanations: E0381, E0382, E0499, E0505. 148For more information about an error, try `rustc --explain E0381`.