Skip to content

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

Closed
@Daniel-A-Gutierrez

Description

@Daniel-A-Gutierrez

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions