Skip to content

Docs for fetch_add/fetch_sub/pow and overflow behavior #40916

Description

fetch_add fetch_sub pow

Do docs for those methods need to explain what happens on overflow? There are three possible overflow behaviors: panic, saturate, wrap. Is it obvious what those methods do on overflow?

Perhaps we should explain? I guess fetch_add and fetch_sub wrap around, while pow panics in debug mode and wraps around in release mode.

cc @alexcrichton

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions