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

Impls for aliased types are ignored #2778

Open
cheblin opened this Issue Aug 19, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@cheblin
Copy link

cheblin commented Aug 19, 2018

Environment

  • Intellij-Rust plugin version: 0.20.2103-182
  • Rust toolchain version: stable-x86_64-pc-windows-msvc
  • IDE name and version: IntelliJ IDEA 2018.2.2 (Ultimate Edition)
    Build #IU-182.4129.26, built on August 16, 2018
    Licensed to Sirguy Chikirev
    Subscription is active until March 21, 2019
    JRE: 1.8.0_152-release-1248-b8 amd64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Windows 10 10.0
  • Operating system:

Problem description

IDE IntelliSense do not recognize Rust type aliases.

Steps to reproduce

create default executable Rust project, and insert this snippet.

struct EE {
    pub field1: u32,
    pub field2: u8,
}

type XX = EE;

impl XX {
    pub fn new() -> XX {
        XX { field1: 2, field2: 3 }
    }
}

fn main() {
    let xx = XX::new(); // new() is not recognized by intellisense
    println!("{:?}", xx.field2); //xx type in not recognized by intellisense

    let yy = EE::new();// new() is not recognized by intellisense
    println!("{:?}", yy.field2); //yy type in not recognized by intellisense
}

but the code is correct and compile / executed properly.

@z2665

This comment has been minimized.

Copy link

z2665 commented Aug 22, 2018

I get the same problem. When I use libc. the type aliases, like pub type c_int = i32; can't recognized by intellisense

@vlad20012 vlad20012 changed the title IDE IntelliSense do not recognize Rust type aliases. Impls for aliased types are ignored Aug 22, 2018

@cheblin

This comment has been minimized.

Copy link
Author

cheblin commented Aug 23, 2018

IDEA cannot recognize aliased types totally... and Impls to.

@vlad20012

This comment has been minimized.

Copy link
Member

vlad20012 commented Aug 23, 2018

@cheblin m? It isn't truth. We support type aliases in all cases except impls for aliased types. If you bumped into a bug, please, provide more info.
image

@cheblin

This comment has been minimized.

Copy link
Author

cheblin commented Aug 26, 2018

capture1
capture2

bors bot added a commit that referenced this issue Aug 26, 2018

Merge #2797
2797: Fix fill struct fields r=vlad20012 a=vlad20012

Fixes [2778 comment](#2778 (comment))

Co-authored-by: vlad20012 <beskvlad@gmail.com>
@vlad20012

This comment has been minimized.

Copy link
Member

vlad20012 commented Aug 26, 2018

@cheblin, yep, the last comment is an unknown bug. I fixed it in #2797. Thanks for the report!

@bors bors bot closed this in #2797 Aug 26, 2018

@Undin Undin reopened this Aug 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment