-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dereferencing boxed tuple doesn't compile properly. #30564
Comments
#30104 seems related. |
It is related to #30104. Looks like an issue with how moves and pattern matching interact. One issue is that |
A simpler example could be: let a = Box::new(("foo".to_owned(), "bar".to_owned()));
let (b, c) = *a; This has to be fixed with: let a = Box::new(("foo".to_owned(), "bar".to_owned()));
let tmp = *a;
let (b, c) = tmp; |
Or
|
One of the duplicate issues notes that this behavior was introduced as a consequence of rust-lang/rfcs#130. |
Is this a dupe of #16223? |
This isn't strictly defined by rust-lang/rfcs#130, but it's a variant of the same issue. |
Sorry -- just to clarify: this is the intended behavior? |
@arielb1 I'm not sure I follow. Unless I missed it, the linked
|
I think I've encountered a bug, as was described in this stack overflow question. In particular, I would expect the syntax in the following code to be allowed:
Instead, I need to do something like
Meta
I tried this on the latest nightly release of
rustc
using the rust playground and it still doesn't work. I'm still somewhat new with rust so let me know if this isn't a bug!The text was updated successfully, but these errors were encountered: