diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2018-03-23 09:27:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-03-23 09:27:06 -0500 |
| commit | 7cf4cb5a7be38fcb3831204eb32ad6e2ef0a9e25 (patch) | |
| tree | 9997fb91ff9e2a46755aabf8fb2ae2c141eae380 /src/librustc_data_structures | |
| parent | 55e1104dd918a809d2751d325c11d59c85485a2e (diff) | |
| parent | a23f685296b2edd59acc998411340184b958ec82 (diff) | |
| download | rust-7cf4cb5a7be38fcb3831204eb32ad6e2ef0a9e25.tar.gz rust-7cf4cb5a7be38fcb3831204eb32ad6e2ef0a9e25.zip | |
Rollup merge of #48265 - SimonSapin:nonzero, r=KodrAus
Add 12 num::NonZero* types for primitive integers, deprecate core::nonzero RFC: https://github.com/rust-lang/rfcs/pull/2307 Tracking issue: ~~https://github.com/rust-lang/rust/issues/27730~~ https://github.com/rust-lang/rust/issues/49137 Fixes https://github.com/rust-lang/rust/issues/27730
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/obligation_forest/node_index.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_data_structures/obligation_forest/node_index.rs b/src/librustc_data_structures/obligation_forest/node_index.rs index a72cc6b57ea..37512e4bcd5 100644 --- a/src/librustc_data_structures/obligation_forest/node_index.rs +++ b/src/librustc_data_structures/obligation_forest/node_index.rs @@ -8,18 +8,18 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -use core::nonzero::NonZero; +use std::num::NonZeroU32; use std::u32; #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct NodeIndex { - index: NonZero<u32>, + index: NonZeroU32, } impl NodeIndex { pub fn new(value: usize) -> NodeIndex { assert!(value < (u32::MAX as usize)); - NodeIndex { index: NonZero::new((value as u32) + 1).unwrap() } + NodeIndex { index: NonZeroU32::new((value as u32) + 1).unwrap() } } pub fn get(self) -> usize { |
