class StopIteration < StandardError

The end of an external iteration: Enumerator#next past the last element. loop rescues it and ends the loop.

e = [1].each
e.next   # => 1
e.next   # raises StopIteration

<prelude>:5355