Switched from FxHashMap to BTreeMap to preserve ordering when iterating.

This commit is contained in:
David Wood 2018-09-11 16:01:53 +02:00
parent 783bad4295
commit 88ca3412e2
No known key found for this signature in database
GPG key ID: 01760B4F9F53F154
2 changed files with 22 additions and 17 deletions

View file

@ -26,19 +26,6 @@ LL | drop(x2); //~ ERROR cannot move `x2` into closure because it is bor
LL | borrow(&*p2);
| ---- borrow later used here
error[E0382]: use of moved value: `x2`
--> $DIR/borrowck-multiple-captures.rs:35:19
|
LL | drop(x2);
| -- value moved here
LL | thread::spawn(move|| {
| ^^^^^^ value used here after move
LL | drop(x1); //~ ERROR capture of moved value: `x1`
LL | drop(x2); //~ ERROR capture of moved value: `x2`
| -- use occurs due to use in closure
|
= note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `x1`
--> $DIR/borrowck-multiple-captures.rs:35:19
|
@ -52,6 +39,19 @@ LL | drop(x1); //~ ERROR capture of moved value: `x1`
|
= note: move occurs because `x1` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `x2`
--> $DIR/borrowck-multiple-captures.rs:35:19
|
LL | drop(x2);
| -- value moved here
LL | thread::spawn(move|| {
| ^^^^^^ value used here after move
LL | drop(x1); //~ ERROR capture of moved value: `x1`
LL | drop(x2); //~ ERROR capture of moved value: `x2`
| -- use occurs due to use in closure
|
= note: move occurs because `x2` has type `std::boxed::Box<i32>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `x`
--> $DIR/borrowck-multiple-captures.rs:46:14
|