Skip to content

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

Closed
@BilakshanP

Description

@BilakshanP

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions