You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
albertlarsan68 opened this issue
Feb 16, 2023
· 2 comments
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
The documentation in these items says clearly "If debug assertions are enabled, a panic is guaranteed".
However, the configuration can be made so that a panic doesn't occur, even though the debug assertions are enabled (through disabling the overflow checks), as shown by this godbolt, while a panic is generated when oveflow checks are enabled (godbolt).
Thus, the documentation is not accurate: while it is true that most of the time that debug assertions are enabled, the overflow checks are also enabled, this is definitly not always true.
The solution would either be to adapt the implementation to the documentation, or the other way round.
The text was updated successfully, but these errors were encountered:
albertlarsan68
added
the
A-docs
Area: Documentation for any part of the project, including the compiler, standard library, and tools
label
Feb 16, 2023
I believe -Coverflow-checks was added after this documentation was written, the solution is to change "when debug assertions are enabled" to "when overflow checks are enabled".
lolbinarycat
added
the
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
label
Mar 31, 2025
Rollup merge of rust-lang#139447 - izarma:issue-108131-fix, r=scottmcm
doc changes: debug assertions -> overflow checks
This PR is for the following issue:
rust-lang#108131
has some changes in docs
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Location
Methods and functions that deal with integers (non exhaustive):
Summary
The documentation in these items says clearly "If debug assertions are enabled, a panic is guaranteed".
However, the configuration can be made so that a panic doesn't occur, even though the debug assertions are enabled (through disabling the overflow checks), as shown by this godbolt, while a panic is generated when oveflow checks are enabled (godbolt).
Thus, the documentation is not accurate: while it is true that most of the time that debug assertions are enabled, the overflow checks are also enabled, this is definitly not always true.
The solution would either be to adapt the implementation to the documentation, or the other way round.
The text was updated successfully, but these errors were encountered: