Skip to content

wrong prompt in nalgebra library with rust analyzer #9006

Closed
@topazus

Description

@topazus

vscode version: 1.56.2, rust-analyzer: get it from vscode marketplace.

when I type the following code in vscode,

extern crate nalgebra as na;
use na::{Matrix3x4, Vector3};

fn main() {
    let v = Vector3::new(1, 2, 3);
    print!("{}", v);
    let m = Matrix3x4::new(11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34);
    print!("{}", m);
}

It gaves the following error prompt: expected 4 arguments, found 3. Here is the screenshot:

Screenshot from 2021-05-26 22-37-25

But I run code in a cargo package with cargo run, it works and get the correct answer.

$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.01s
     Running `target/debug/matrices`

  ┌   ┐
  │ 1 │
  │ 2 │
  │ 3 │
  └   ┘


  ┌             ┐
  │ 11 12 13 14 │
  │ 21 22 23 24 │
  │ 31 32 33 34 │
  └             ┘

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