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

Problem with enum method parameter #10830

Open
smiera opened this issue Aug 28, 2023 · 2 comments
Open

Problem with enum method parameter #10830

smiera opened this issue Aug 28, 2023 · 2 comments

Comments

@smiera
Copy link

smiera commented Aug 28, 2023

Environment

  • IntelliJ Rust plugin version: 0.4.200.5421-232
  • Rust toolchain version: stable-aarch64-apple-darwin rustc 1.72.0 (5680fa18f 2023-08-23)
  • IDE name and version: IntelliJ IDEA 2023.2.1 (Ultimate Edition) Build #IU-232.9559.62, built on August 23, 2023
  • Operating system: MacOS Ventura 13.5 (22G74)

Problem description

I play with rustlings. In enum2.rs exercise, line 29(message.call();) plugin show error:
This function takes 1 parameter but 0 parameters were supplied [E0061]
But method call does't have any parameter

impl Message {
    fn call(&self) {
        println!("{:?}", self);
    }
}

Here is example from playground

Знімок екрана 2023-08-28 о 12 56 29
@smiera
Copy link
Author

smiera commented Aug 28, 2023

FYI: when I copy/paste this code from rustlings project to another, then everything work fine.

@Maksim20023
Copy link
Collaborator

Hi, thank you for reaching us.
The Rustlings project was developed as an interactive trainer with a command-line interface, so exercise files are not included in the project module tree. You can see a corresponding notification, file is not included in module tree, analysis not available at the top of the code editor window. This means that the Rust plugin cannot analyze the code in this file. You can find detailed information about the modules, packages, and crates at this link
Therefore, as you mentioned, analysis works correctly if you place the exercise code in a new project.

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