Skip to content

Rust Analyzer Falsely Reports Mismatched-Arg-Count Error in nalgebra DMatrix::from_fn #11148

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

Closed
Daniel-A-Gutierrez opened this issue Dec 31, 2021 · 1 comment

Comments

@Daniel-A-Gutierrez
Copy link

My Repo With a Labeled Commit is here : https://github.com/Daniel-A-Gutierrez/rust_sandbox
The old (vscode default) and nightly build of rust-analyzer report an error at line 12 of experiments/c_automata1.rs
"expected 1 argument, found 3
rust-analyzermismatched-arg-count"

The code is correct and runs, restarting vs code and resetting the extension don't fix the error being highlighted, neither does running Rust Analyzer:Restart Server.

As a strange note the official rust extension doesn't even show most of the functions in the nalgebra crate existing.

Here is a simplified example of the code

extern crate approx;<b>
extern crate nalgebra as na;
use na::*;
pub fn matrices()
{
    let m2 = na::DMatrix::from_fn(3,3,|_,_| 1); //ERROR HERE
    println!("This is the new matrix {:?}", m2);
}

rust-analyzer version: 3d63abf 2021-12-31 nightly

rustc 1.56.0 (09c42c458 2021-10-18)

@lnicola
Copy link
Member

lnicola commented Dec 31, 2021

Duplicate of #5441.

@lnicola lnicola closed this as completed Dec 31, 2021
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