Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. fn main() {
  2. println!("{:?}", {
  3. fn foo() -> impl Iterator { panic!() }
  4. });
  5. }
  6.  
  7.  
  8. /* ~~~~=== stderr ===~~~~
  9. Compiling playground v0.0.1 (file:///playground)
  10. error[E0277]: the trait bound `(): std::iter::Iterator` is not satisfied
  11. --> src/main.rs:5:21
  12. |
  13. 5 | fn foo() -> impl Iterator { panic!() }
  14. | ^^^^^^^^^^^^^ `()` is not an iterator; maybe try calling `.iter()` or a similar method
  15. |
  16. = help: the trait `std::iter::Iterator` is not implemented for `()`
  17. = note: the return type of a function must have a statically known size
  18.  
  19. error: aborting due to previous error
  20.  
  21. For more information about this error, try `rustc --explain E0277`.
  22. error: Could not compile `playground`.
  23.  
  24. To learn more, run the command again with --verbose.
  25.  
  26. */
  27.  
  28. /* ~~~~=== stdout ===~~~~
  29.  
  30. */
Add Comment
Please, Sign In to add comment