Skip to content
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

Tuple indexing as tuple.0.0 is not equivalent to tuple.0 .0 in linting... #13793

Closed
BilakshanP opened this issue Dec 18, 2022 · 1 comment
Closed

Comments

@BilakshanP
Copy link

BilakshanP commented Dec 18, 2022

Rust analyzer does not seem to be on par with the following merge: rust-lang/rust#71322

As it considers tuple.0.0 == tuple.0 which is not true anymore and only lints properly if tuple indexing is like this: tuple.0 .0 as now the space is not essential and code compiles succesfully by the compiler none the less

let a = ((1, 2), (3, 4)); // analyzer lints it as: ((i32, i32), (i32, i32)) -- which is correct
let b = a.0.0;            // analyzer lints it as: (i32, i32) -- which is incorrect
                          // and instead it should be just i32

println("{:?}", b); // yields: 1

rustc version: rustc 1.65.0 (897e37553 2022-11-02)
rust-analyzer versiob: v0.3.1317

Edit: Pre-release version: v0.4.1323 does not supports it either

@bjorn3
Copy link
Member

bjorn3 commented Dec 18, 2022

Duplicate of #1109

@bjorn3 bjorn3 marked this as a duplicate of #1109 Dec 18, 2022
@bjorn3 bjorn3 closed this as completed Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants