diff options
| author | Josh Stone <jistone@redhat.com> | 2017-04-20 15:12:42 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2017-04-20 21:16:31 -0700 |
| commit | c903ac64e58241a71ec42e791b0cc1451ffc3840 (patch) | |
| tree | 82e191ca7c8c27ecb90c19b24db798625fa678f7 /src/test | |
| parent | 313aab8fbeb98730f8ffa741ccf54f843d5e3525 (diff) | |
Remove num::{Zero,One}
[unstable, deprecated since 1.11.0]
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/run-pass/issue-8460.rs | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/src/test/run-pass/issue-8460.rs b/src/test/run-pass/issue-8460.rs index 5148be5af83..17ea5b9a794 100644 --- a/src/test/run-pass/issue-8460.rs +++ b/src/test/run-pass/issue-8460.rs @@ -9,11 +9,22 @@ // except according to those terms. // ignore-emscripten no threads support -#![feature(rustc_attrs, zero_one)] +#![feature(rustc_attrs)] -use std::num::Zero; use std::thread; +trait Int { + fn zero() -> Self; + fn one() -> Self; +} +macro_rules! doit { + ($($t:ident)*) => ($(impl Int for $t { + fn zero() -> $t { 0 } + fn one() -> $t { 1 } + })*) +} +doit! { i8 i16 i32 i64 isize } + macro_rules! check { ($($e:expr),*) => { $(assert!(thread::spawn({ @@ -24,21 +35,21 @@ macro_rules! check { fn main() { check