diff --git a/src/libcore/tests/nonzero.rs b/src/libcore/tests/nonzero.rs index 8d39298bac3d1..bbb1ef76bccec 100644 --- a/src/libcore/tests/nonzero.rs +++ b/src/libcore/tests/nonzero.rs @@ -121,3 +121,10 @@ fn test_match_nonzero_const_pattern() { _ => panic!("Expected the const item as a pattern to match.") } } + +#[test] +fn test_from_nonzero() { + let nz = NonZeroU32::new(1).unwrap(); + let num: u32 = nz.into(); + assert_eq!(num, 1u32); +} diff --git a/src/test/run-pass/nonzero.rs b/src/test/run-pass/nonzero.rs deleted file mode 100644 index 0f2b1dcc8d3a5..0000000000000 --- a/src/test/run-pass/nonzero.rs +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -fn main() { - use std::num::NonZeroU32; - let nz = NonZeroU32::new(5).unwrap(); - let num: u32 = nz.into(); -} -