-
Notifications
You must be signed in to change notification settings - Fork 13k
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
saturating_add
doc is not clear enough
#64940
Comments
This comment has been minimized.
This comment has been minimized.
Hey I tried solving this but wasn't really sure how to. I believe the implementation to the LLVM generation is right here. rust/src/librustc_codegen_llvm/intrinsic.rs Lines 471 to 508 in 22bc9e1
Hope someone can solve this! |
Turn out I was wrong! The I would add some doctests to show that and close this issue. |
saturating_add
has overhead?saturating_add
doc is not clear enough
Add lower bound doctests for `saturating_{add,sub}` signed ints Closes rust-lang#64940
Godbolt link: https://godbolt.org/z/9rm4jF
So I expect these two functions has the same assembly:
But the result is not:
The text was updated successfully, but these errors were encountered: