Closed
Description
Minimal example:
fn main() {
// Behaviour does not appear linked to the use of unimplemented!()
let x = unimplemented!();
// Move the definition of g above this line to get this to compile
x.0; // E0282: cannot infer type for `_`
let g = || {
let x: (i32, i32) = x;
};
}
This appears in stable, beta and nightly.
This appears to be a case where type inference should not depend on the order of these statements in the function.
This problem can be a deal-breaker when unnameable types are involved and reordering the statements isn't possible.