Skip to content

Instantly share code, notes, and snippets.

@DaGenix
Created June 30, 2013 16:53
Show Gist options
  • Save DaGenix/5895932 to your computer and use it in GitHub Desktop.
Save DaGenix/5895932 to your computer and use it in GitHub Desktop.
Seemingly incorrect use of uninitialized variable error
fn test() -> (u32, u32) {
return (0, 0,);
}
fn main() {
let mut X0: u32;
let mut X1: u32;
(X0, X1) = test();
}
@DaGenix
Copy link
Author

DaGenix commented Jun 30, 2013

Compiling this with 88830996d811be3ff833ba590c98f28daaf31f43 produces:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment