Rollup merge of #50808 - SimonSapin:nonzero, r=alexcrichton

Stabilize num::NonZeroU*

Tracking issue: https://github.com/rust-lang/rust/issues/49137
This commit is contained in:
kennytm 2018-05-17 03:07:52 +08:00
commit 02aedec722
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C
14 changed files with 18 additions and 150 deletions

View file

@ -10,11 +10,9 @@
// https://github.com/rust-lang/rust/issues/41898
#![feature(nonzero, const_fn)]
extern crate core;
use core::nonzero::NonZero;
use std::num::NonZeroU64;
fn main() {
const FOO: NonZero<u64> = unsafe { NonZero::new_unchecked(2) };
const FOO: NonZeroU64 = unsafe { NonZeroU64::new_unchecked(2) };
if let FOO = FOO {}
}

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(nonzero, core)]
use std::mem::size_of;
use std::num::NonZeroUsize;
use std::ptr::NonNull;