Closed
Description
This snipped of rust code
fn fail() -> impl Iterator<Item = u32> {
unimplemented!()
}
fn main() {}
fails to compile with error:
--> src/main.rs:2:14
|
2 | fn fail() -> impl Iterator<Item = u32> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method
|
= help: the trait `std::iter::Iterator` is not implemented for `()`
= note: the return type of a function must have a statically known size
Metadata
Metadata
Assignees
Labels
No labels