Skip to content

Add signed integer types as implementors of the nonzeroable traits#7

Merged
bors[bot] merged 3 commits intomasterfrom
signed-ints
Dec 22, 2019
Merged

Add signed integer types as implementors of the nonzeroable traits#7
bors[bot] merged 3 commits intomasterfrom
signed-ints

Conversation

@antifuchs
Copy link
Owner

No description provided.

This reflects the stable additions from a few releases ago.
@antifuchs
Copy link
Owner Author

bors r+

bors bot added a commit that referenced this pull request Dec 14, 2019
7: Add signed integer types as implementors of the nonzeroable traits r=antifuchs a=antifuchs



Co-authored-by: Andreas Fuchs <asf@boinkor.net>
@bors
Copy link
Contributor

bors bot commented Dec 14, 2019

Timed out

Since casting negative numbers to usize seems really wrong (and it
triggers rust-lang/rust#67539 on nightlies).
Let's use .count_ones() to get a guarantee that the number we have is
non-zero instead.
* Allow main in doctests, we need them for no_std.
* Add a Safety section to as_nonzero_unchecked.
@antifuchs
Copy link
Owner Author

bors r+

bors bot added a commit that referenced this pull request Dec 22, 2019
7: Add signed integer types as implementors of the nonzeroable traits r=antifuchs a=antifuchs



Co-authored-by: Andreas Fuchs <asf@boinkor.net>
@bors
Copy link
Contributor

bors bot commented Dec 22, 2019

Build succeeded

@bors bors bot merged commit f4ebb71 into master Dec 22, 2019
@bors bors bot deleted the signed-ints branch December 22, 2019 21:43
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.

1 participant