We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Array type inference not as good as Tuple?
I tried this code:
//No error fn test_tuple() { let arr=[(0u32,0);2]; let mut last=None; for &(x,y) in arr.iter(){ if let Some((x,y))=last{ dbg!(x,y); } last=Some((x,y)) } } //Compile time error fn test_arr() { let arr=[[0u32,0];2]; let mut last=None; for &[x,y] in arr.iter(){ if let Some([x,y])=last{ dbg!(x,y); } last=Some([x,y]) } } fn main(){ test_tuple(); test_arr(); }
I expected to see this happen: It to compile
Instead, this happened: It didnt compile
Same behavior on stable and nghtly
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Array type inference not as good as Tuple?
I tried this code:
I expected to see this happen: It to compile
Instead, this happened: It didnt compile
Same behavior on stable and nghtly
The text was updated successfully, but these errors were encountered: