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

mismatched-arg-count false positive in example with required-features #13416

Open
Seldom-SE opened this issue Oct 14, 2022 · 1 comment
Open
Labels
A-nameres name, path and module resolution C-bug Category: bug

Comments

@Seldom-SE
Copy link

rust-analyzer version: 0.3.1238-standalone (61504c8 2022-10-08)

rustc version: 1.64.0 (a55dd71d5 2022-09-19)

I'm getting an error in the example for the following crate, even though it runs fine:

Cargo.toml

[package]
name = "bevy_test" # Not actually Bevy-related
version = "0.1.0"
edition = "2021"

[features]
feature = []

[[example]]
name = "example"
required-features = [ "feature" ]

src/lib.rs

#[derive(Default)]
pub struct Struct<T>(T);

impl Struct<Type1> {
    pub fn do_stuff(&self) {}
}

#[cfg(feature = "feature")]
impl Struct<Type2> {
    pub fn do_stuff(&self, _: i32) {}
}

#[derive(Default)]
pub struct Type1;

#[cfg(feature = "feature")]
#[derive(Default)]
pub struct Type2;

examples/example.rs (run with cargo run --example example --features feature)

use bevy_test::{Struct, Type2};

fn main() {
    Struct::<Type2>::default().do_stuff(0); // expected 0 arguments, found 1 rust-analyzer(mismatched-arg-count)
}

Thank you!

@Seldom-SE
Copy link
Author

Error is also in rust-analyzer version: 0.4.1244-standalone (44fbe52 2022-10-14)

@Veykril Veykril added A-nameres name, path and module resolution C-bug Category: bug labels Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-nameres name, path and module resolution C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants