You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler rejects this code with the following error message:
rustc 1.15.1 (021bd294c 2017-02-08)
error[E0382]: use of collaterally moved value: `(t:BinTree::Node).rhs`
--> <anon>:21:38
|
21 | BinTree::Node { lhs: l, rhs: r } => print_tree(*l),
| - ^ value used here after move
| |
| value moved here
|
= note: move occurs because `(t:BinTree::Node).lhs` has type `Box<BinTree>`, which does not implement the `Copy` trait
error: aborting due to previous error
A very nice guy on the IRC pointed out that this bug seems to be related to #30104, #34859 and #30564. So I close it again. Sorry for any inconvenience.
The compiler complains with an error but the code is supposed to be accepted:
I tried this code:
I expected to see this happen:
The compiler should accept this code as it does when I change it to:
The compiler also has no problem, if I change the match arm to:
Instead, this happened:
The compiler rejects this code with the following error message:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: