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

Incorrect type annotation displayed #13473

Closed
nikonthethird opened this issue Oct 24, 2022 · 2 comments
Closed

Incorrect type annotation displayed #13473

nikonthethird opened this issue Oct 24, 2022 · 2 comments

Comments

@nikonthethird
Copy link

struct A(u8);
struct B(A);

fn main() {
    let b = B(A(10));
    let supposed_to_be_u8 = b.0.0;
}

This code displays the following incorrect type annotation (A instead of u8):

image

rustc 1.64.0 (a55dd71d5 2022-09-19)
rust-analyzer version: 0.3.1248-standalone

@bjorn3
Copy link
Member

bjorn3 commented Oct 24, 2022

This may be a duplicate of #1109. Does b.0 .0 with the extra space work?

@nikonthethird
Copy link
Author

Yes, that works, this is a duplicate of the other issue.

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