-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs for fetch_add/fetch_sub/pow and overflow behavior #40916
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
Comments
frewsxcv
added
the
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
label
Mar 30, 2017
The default behavior for overflow is "panic in debug mode, wrap in release mode." So anything that does that does not need a note. Anything else should get one. |
In that case, we must add a note for |
ghost
mentioned this issue
Mar 30, 2017
Dupe of #34618? |
Yeah just adding a note here about overflow should be fine, but yeah looks like a dupe of #34618 so closing |
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 2, 2017
… r=alexcrichton Add a note about overflow for fetch_add/fetch_sub Fixes rust-lang#40916 r? @steveklabnik
bors
added a commit
that referenced
this issue
Apr 2, 2017
…hton Add a note about overflow for fetch_add/fetch_sub Fixes #40916 Fixes #34618 r? @steveklabnik
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 3, 2017
… r=alexcrichton Add a note about overflow for fetch_add/fetch_sub Fixes rust-lang#40916 Fixes rust-lang#34618 r? @steveklabnik
frewsxcv
added a commit
to frewsxcv/rust
that referenced
this issue
Apr 3, 2017
… r=alexcrichton Add a note about overflow for fetch_add/fetch_sub Fixes rust-lang#40916 Fixes rust-lang#34618 r? @steveklabnik
arielb1
pushed a commit
to arielb1/rust
that referenced
this issue
Apr 5, 2017
… r=alexcrichton Add a note about overflow for fetch_add/fetch_sub Fixes rust-lang#40916 Fixes rust-lang#34618 r? @steveklabnik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-docs
Area: documentation for any part of the project, including the compiler, standard library, and tools
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
andfetch_sub
wrap around, whilepow
panics in debug mode and wraps around in release mode.cc @alexcrichton
The text was updated successfully, but these errors were encountered: