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

Compileable code still reports an issue in rust-analyzer #18974

Closed
matzipan opened this issue Jan 18, 2025 · 0 comments · Fixed by #18976
Closed

Compileable code still reports an issue in rust-analyzer #18974

matzipan opened this issue Jan 18, 2025 · 0 comments · Fixed by #18976
Assignees
Labels
C-bug Category: bug

Comments

@matzipan
Copy link

rust-analyzer version: 0.3.2264

rustc version: rustc 1.86.0-nightly (6067b3631 2025-01-17)

editor or extension: VS code

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)

repository link (if public, optional): /~https://github.com/lox-space/lox

code snippet to reproduce:

#[derive(PartialEq, Clone, Debug)]
pub enum KvnDeserializerErr<I> {
    InvalidDateTimeFormat { input: I },
    InvalidNumberFormat { input: I },
    InvalidStringFormat { input: I },
    InvalidStateVectorFormat { input: I },
    InvalidCovarianceMatrixFormat { input: I },
    KeywordNotFound { expected: I },
    // Has a second meaning: it stops the iterator for vector type deserializers
    UnexpectedKeyword { found: I, expected: I },
    EmptyKeyword { input: I },
    EmptyValue { input: I },
    UnexpectedEndOfInput { keyword: I },
}

fn bla() -> bool {
    let _x: Result<i32, KvnDeserializerErr<String>> =
        Err(KvnDeserializerErr::<String>::UnexpectedKeyword {
            found: "aa".to_string(),
            expected: "COMMENT_LIST".to_string(),
        });

    return false;
}

The following code compiles fine, but rust-analyzer is finding this issue: "generic arguments are not allowed on modules" https://doc.rust-lang.org/stable/error_codes/E0109.html.

This is even more odd since KvnDeserializerErr is not a module in the first place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
2 participants