Skip to content

Investigate panic behavior of sum #35807

Closed
@steveklabnik

Description

@steveklabnik

Originally reported on HN: https://news.ycombinator.com/item?id=12316209

Basically, the docs for Iterator::sum say

Panics

When calling sum and a primitive integer type is being returned, this method will panic if the computation overflows.

Is this a special behavior of sum, or is this just the regular behavior of arithmetic? If it's the latter, then these docs are probably wrong / unnecessary.

I am not sure, but am willing to bet that this might just be out of date. To resolve this ticket, either the behavior should be confirmed, or the docs should be updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions