Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- println!("{:?}", {
- fn foo() -> impl Iterator { panic!() }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (file:///playground)
- error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied
- --> src/main.rs:5:21
- |
- 5 | fn foo() -> impl Iterator { panic!() }
- | ^^^^^^^^^^^^^ `()` 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
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0277`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Add Comment
Please, Sign In to add comment