rust/tests/ui/inference/question-mark-type-infer.st...

18 lines
645 B
Plaintext

error[E0283]: type annotations needed
--> $DIR/question-mark-type-infer.rs:10:21
|
LL | l.iter().map(f).collect()?
| ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect`
|
= note: cannot satisfy `_: FromIterator<Result<i32, ()>>`
note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
help: consider specifying the generic argument
|
LL | l.iter().map(f).collect::<Vec<_>>()?
| ++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0283`.