diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2017-06-29 01:03:35 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2017-07-22 20:38:16 +0200 |
| commit | 0a08ad0443631ca86e61526916fb4ee61fe1abce (patch) | |
| tree | c8dd36ae38044adabc45b83e84d08333eb118dd7 /src/librustc_data_structures | |
| parent | e9af03a22279b62ded4c7ea897d5ac3a9b54728c (diff) | |
| download | rust-0a08ad0443631ca86e61526916fb4ee61fe1abce.tar.gz rust-0a08ad0443631ca86e61526916fb4ee61fe1abce.zip | |
Rename {NonZero,Shared,Unique}::new to new_unchecked
Diffstat (limited to 'src/librustc_data_structures')
| -rw-r--r-- | src/librustc_data_structures/array_vec.rs | 2 | ||||
| -rw-r--r-- | src/librustc_data_structures/obligation_forest/node_index.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_data_structures/array_vec.rs b/src/librustc_data_structures/array_vec.rs index 078bb801751..de028f61090 100644 --- a/src/librustc_data_structures/array_vec.rs +++ b/src/librustc_data_structures/array_vec.rs @@ -146,7 +146,7 @@ impl<A: Array> ArrayVec<A> { tail_start: end, tail_len: len - end, iter: range_slice.iter(), - array_vec: Shared::new(self as *mut _), + array_vec: Shared::new_unchecked(self as *mut _), } } } diff --git a/src/librustc_data_structures/obligation_forest/node_index.rs b/src/librustc_data_structures/obligation_forest/node_index.rs index 023c56ca59b..9fa6045146d 100644 --- a/src/librustc_data_structures/obligation_forest/node_index.rs +++ b/src/librustc_data_structures/obligation_forest/node_index.rs @@ -19,7 +19,7 @@ pub struct NodeIndex { impl NodeIndex { pub fn new(value: usize) -> NodeIndex { assert!(value < (u32::MAX as usize)); - unsafe { NodeIndex { index: NonZero::new((value as u32) + 1) } } + unsafe { NodeIndex { index: NonZero::new_unchecked((value as u32) + 1) } } } pub fn get(self) -> usize { |
