From cb1faf8aefe4bbe8844f2189618cb9b9a1f898ca Mon Sep 17 00:00:00 2001 From: Paddy Horan Date: Sun, 22 Sep 2019 19:13:07 -0400 Subject: [PATCH] [Rust] Fixes "common" sub crate using nightly and master (#3965) --- rust/common/src/array.rs | 2 +- rust/common/src/lib.rs | 2 +- rust/common/src/packed_func.rs | 2 +- rust/frontend/src/lib.rs | 2 +- rust/macros/src/lib.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/rust/common/src/array.rs b/rust/common/src/array.rs index 4ccfb4bf42d9..5cc8cc2ef051 100644 --- a/rust/common/src/array.rs +++ b/rust/common/src/array.rs @@ -97,7 +97,7 @@ pub struct TVMContext { impl<'a> From<&'a TVMContext> for DLContext { fn from(ctx: &'a TVMContext) -> Self { Self { - device_type: ctx.device_type as u32, + device_type: ctx.device_type as i32, device_id: ctx.device_id as i32, } } diff --git a/rust/common/src/lib.rs b/rust/common/src/lib.rs index c92865872caa..b1362aeb29ba 100644 --- a/rust/common/src/lib.rs +++ b/rust/common/src/lib.rs @@ -20,7 +20,7 @@ //! This crate contains the refactored basic components required //! for `runtime` and `frontend` TVM crates. -#![feature(box_syntax, type_alias_enum_variants, trait_alias)] +#![feature(box_syntax, trait_alias)] #[macro_use] extern crate failure; diff --git a/rust/common/src/packed_func.rs b/rust/common/src/packed_func.rs index c75e9020cc93..0f3c7755da98 100644 --- a/rust/common/src/packed_func.rs +++ b/rust/common/src/packed_func.rs @@ -83,7 +83,7 @@ macro_rules! TVMPODValue { use $name::*; #[allow(non_upper_case_globals)] unsafe { - match type_code { + match type_code as i32 { DLDataTypeCode_kDLInt => Int($value.v_int64), DLDataTypeCode_kDLUInt => UInt($value.v_int64), DLDataTypeCode_kDLFloat => Float($value.v_float64), diff --git a/rust/frontend/src/lib.rs b/rust/frontend/src/lib.rs index adb258dbd3d9..9bf982ee29c8 100644 --- a/rust/frontend/src/lib.rs +++ b/rust/frontend/src/lib.rs @@ -30,7 +30,7 @@ //! //! Checkout the `examples` repository for more details. -#![feature(box_syntax, type_alias_enum_variants)] +#![feature(box_syntax)] #[macro_use] extern crate failure; diff --git a/rust/macros/src/lib.rs b/rust/macros/src/lib.rs index 704f7c1de58b..f6b1afd2c32b 100644 --- a/rust/macros/src/lib.rs +++ b/rust/macros/src/lib.rs @@ -17,7 +17,7 @@ * under the License. */ -#![feature(bind_by_move_pattern_guards, proc_macro_span)] +#![feature(proc_macro_span)] extern crate proc_macro;