-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Seemingly incorrect error about use of uninitialized value #7508
Comments
You are trying to pattern match outside of a let/match, so this code wouldn't work anyway. Its just that the checker for unintialized variables gets to the tuple expression first. This is just an unclear error message, not a bug. |
Ok, makes sense. Isn't it still an issue though that the error message is very unhelpful? Someone coming from a language that allows this type of construct (I think Scala does) will be confused. |
I don't understand why this parses. What is |
I think it parses because we accept an arbitrary expression on the LHS, but certainly there should be some point, either in typeck or before, that enforces that the LHS is an lvalue...perhaps there isn't? |
|
The following program:
Gives me the error:
multi-bind-issue.rs:9:5: 9:7 error: use of possibly uninitialized variable: X0
multi-bind-issue.rs:9 (X0, X1) = test();
^~
multi-bind-issue.rs:9:9: 9:11 error: use of possibly uninitialized variable: X1
multi-bind-issue.rs:9 (X0, X1) = test();
^~
error: aborting due to 2 previous errors
Which seems wrong, since the use its complaining about is the initialization of the variables.
Compiled with: 8883099
The text was updated successfully, but these errors were encountered: