Skip to content

Overflowing panics when debug asserts enabled or overflow checks? #108131

Open
@albertlarsan68

Description

@albertlarsan68

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.

Metadata

Metadata

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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions