Skip to content

wrapping_rem methods should document panic-on-zero #116063

Closed
@yoshuawuyts

Description

@yoshuawuyts

Location

All wrapping_rem methods.

Summary

As reported in yoshuawuyts/futures-concurrency#156, when calling the wrapping_rem functions with a value of 0, a panic is triggered. The documentation of the wrapping_rem method should include a # panic section making note of this.

Example

playground

100usize.wrapping_rem(0);
thread 'main' panicked at 'attempt to calculate the remainder with a divisor of zero',

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsLibs-SmallLibs issues that are considered "small" or self-containedT-libsRelevant to the library team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions