You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I understand the "never" type (!) returned by unimplemented!() should satisfy any type constrain but this seems to fail when using impl Trait as a output.
error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied
--> src/main.rs:1:11
|
1 | fn f() -> implIterator<Item = usize>{
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `()` 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
From what I understand the "never" type (!) returned by
unimplemented!()
should satisfy any type constrain but this seems to fail when using impl Trait as a output.I tried this code:
I expected this to compile.
Instead, this happened:
Meta
The text was updated successfully, but these errors were encountered: