-
Notifications
You must be signed in to change notification settings - Fork 30
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
Port NonZero optimization to stable Rust #33
The head ref may contain hidden characters: "\u2026"
Conversation
2bccc2b
to
2ad796d
Compare
src/util.rs
Outdated
impl NonZeroUsize { | ||
#[inline] | ||
pub unsafe fn new(value: usize) -> Self { | ||
NonZeroUsize(&*(value as *const u8)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug_assert! it's nonzero?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core::nonzero::NonZero
doesn’t, but sure. Done.
@bors-servo r+ |
📌 Commit 8d80121 has been approved by |
Port NonZero optimization to stable Rust … and various drive-by fixes. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/tendril/33) <!-- Reviewable:end -->
☀️ Test successful - status-travis |
"unstable" Cargo features are now no-ops, to be removed. servo/tendril#33 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/284) <!-- Reviewable:end -->
"unstable" Cargo features are now no-ops, to be removed. servo/tendril#33 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/284) <!-- Reviewable:end -->
"unstable" Cargo features are now no-ops, to be removed. servo/tendril#33 <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/284) <!-- Reviewable:end -->
… and various drive-by fixes.
This change is