From 95c1d817ae6ec50d3c636c54e33b4d51cab57148 Mon Sep 17 00:00:00 2001 From: csmoe <35686186+csmoe@users.noreply.github.com> Date: Mon, 17 Sep 2018 16:35:08 +0800 Subject: [PATCH] move from_nonzero test from run-pass to libcore --- src/libcore/tests/nonzero.rs | 7 +++++++ src/test/run-pass/nonzero.rs | 16 ---------------- 2 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 src/test/run-pass/nonzero.rs 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(); -} -