Skip to content
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

Added a note for the usage of abs() with ::MIN #16769

Merged
merged 1 commit into from
Aug 31, 2014

Conversation

robertg
Copy link

@robertg robertg commented Aug 26, 2014

There wasn't a note for the behaviour of ::MIN with abs, this PR should fix that.

@robertg robertg changed the title Added a note for usage of abs() with ::MIN. Added a note for the usage of abs() with ::MIN Aug 26, 2014
@lilyball
Copy link
Contributor

This makes it sound like this behavior is restricted solely to int. It should in fact happen with any 2's-complement signed integral type (such as i8, i16, etc).

@robertg
Copy link
Author

robertg commented Aug 26, 2014

@kballard I was thinking about that, would "signed integer" cover all of those types?

The reason I used int was because of another doc note:

/// For int:

Should I also fix that usage of int?

@klutzy
Copy link
Contributor

klutzy commented Aug 27, 2014

Hmm, my main interest in #16707 was that we need to decide general semantic of abs method rather than specific built-in types. I'll describe the issue more at #16707.
Anyway, the patch describes current situation which clearly improves documentation. Thanks!

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 29, 2014
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Aug 31, 2014
@bors bors merged commit c09c038 into rust-lang:master Aug 31, 2014
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Mar 10, 2024
fix: Function argument type inference with associated type impl trait

Fixes rust-lang#15412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify negative-returning behavior of abs method
5 participants