We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 938552a commit 13d17adCopy full SHA for 13d17ad
src/librustc_data_structures/obligation_forest/node_index.rs
@@ -19,7 +19,7 @@ pub struct NodeIndex {
19
impl NodeIndex {
20
pub fn new(value: usize) -> NodeIndex {
21
assert!(value < (u32::MAX as usize));
22
- unsafe { NodeIndex { index: NonZero::new_unchecked((value as u32) + 1) } }
+ NodeIndex { index: NonZero::new((value as u32) + 1).unwrap() }
23
}
24
25
pub fn get(self) -> usize {
0 commit comments