Intermediate Rust
Q73 / 100

What is Rust's type inference limitations?

Correct! Well done.

Incorrect.

The correct answer is B) Rust cannot infer type parameters that don't appear in method arguments; use turbofish ::<> syntax or annotate the variable

B

Correct Answer

Rust cannot infer type parameters that don't appear in method arguments; use turbofish ::<> syntax or annotate the variable

Explanation

let v = Vec::new() fails (can't infer T). let v: Vec<i32> = Vec::new() or Vec::<i32>::new() works. Iterator collect() often needs type annotation.

Progress
73/100