Skip to content

Incorrect "expected 1 argument, found 2" using nalgebra's DVector::from_iterator #11715

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
Omnikar opened this issue Mar 15, 2022 · 1 comment

Comments

@Omnikar
Copy link

Omnikar commented Mar 15, 2022

rust-analyzer version: rust-analyzer 5e8515870 2022-03-14 dev

rustc version: rustc 1.58.1 (db9d1b20b 2022-01-20)

I am using the the from_iterator method on the DVector type in the nalgebra crate, passing in two arguments: row count and the iterator itself. My code compiles and runs as expected, but rust-analyzer gives the error "expected 1 argument, found 2". I imagine this is related to the fact that there are multiple different signatures for the from_iterator method based on the subtype of Matrix that is being used.

Minimal reproducible example:

use nalgebra::DVector;

fn main() {
    let data = [1.0, 2.0, 3.0];
    let vector = DVector::<f64>::from_iterator(data.len(), data.into_iter());
    println!("{}", vector);
}
@flodiebold
Copy link
Member

Duplicate of #8654 / #5441.

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