-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve some comments for non-zero ops #118313
Improve some comments for non-zero ops #118313
Conversation
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
@bors rollup |
@bors r+ rollup |
☀️ Test successful - checks-actions |
Finished benchmarking commit (601a427): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 674.035s -> 674.674s (0.09%) |
Fix comments for unsigned non-zero `checked_add`, `saturating_add` While looking at rust-lang#118313, I happened to notice that two of the expanded comments appear to be slightly inaccurate. For these two methods, `other` is an ordinary unsigned integer, so it can be zero. Since the sum of non-zero and zero is always non-zero, the safety argument holds even when `other` is zero.
Rollup merge of rust-lang#118397 - Zalathar:nonzero, r=WaffleLapkin Fix comments for unsigned non-zero `checked_add`, `saturating_add` While looking at rust-lang#118313, I happened to notice that two of the expanded comments appear to be slightly inaccurate. For these two methods, `other` is an ordinary unsigned integer, so it can be zero. Since the sum of non-zero and zero is always non-zero, the safety argument holds even when `other` is zero.
This makes them a bit more explicit/correct.