Skip to content

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

Merged
bors merged 1 commit intorust-lang:masterfrom
robertg:abs_doc_addition
Aug 31, 2014
Merged

Added a note for the usage of abs() with ::MIN#16769
bors merged 1 commit intorust-lang:masterfrom
robertg:abs_doc_addition

Conversation

@robertg
Copy link
Contributor

@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
Contributor 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
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Mar 22, 2026
```
$ git log --oneline 85eff7c80277b57f78b11e28d14154ab12fcf643..292f395c297d4f99171325b0842ac4ea4ff3b386
292f395c2 (HEAD) [stable 1.94] Fix symlink_and_directory when running in a long target dir name (rust-lang#16777)
d00475981 Fix symlink_and_directory when running in a long target dir name (rust-lang#16775)
ce98781f7 [stable 1.94] Update tar to 0.4.45 (rust-lang#16769)
fec7f9297 Update tar to 0.4.45
5e256e377 Add a test for a tar file with a symlink and directory of the same name
1ed92053d test: Remove unused docker ip_address (rust-lang#16636)
d7a2a0307 Increase cache_lock test timeout (rust-lang#16545)
95d93fb89 Don't check the specific build-std output
dfbe729f6 chore: Updated compiler errors for Rust 1.93 (rust-lang#16543)
cb03b21f6 Update cargo-semver-checks to 0.47.0
f7777c4f9 test(build-std): Update error message (rust-lang#16658)
a56abe18a Disable custom target JSON spec test
634668d49 fix: `--remap-path-scope` stabilized in 1.95-nightly (rust-lang#16536)
d428eaa44 fix(script): surpress `unused_features` lint for embedded (rust-lang#16714)
e7b27c7f9 test(git): Mark a test as non-deterministic (rust-lang#16706)
38922ca44 test(replace): Mark a test as non-deterministic (rust-lang#16700)
```
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