From 3e2046214ca7054bb438259c0287568976323040 Mon Sep 17 00:00:00 2001 From: est31 Date: Tue, 6 Dec 2016 00:48:54 +0100 Subject: [PATCH] Try to fix some things * shift so that no panics are generated (otherwise results in linker error) * no_std as insurance to not get into issues with errors like "cannot satisfy dependencies so `rustc_i128` only shows up once" (pure guessing here, but it doesn't hurt...) --- src/libcompiler_builtins/lib.rs | 4 ++-- src/librustc_i128/lib.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libcompiler_builtins/lib.rs b/src/libcompiler_builtins/lib.rs index 790de76cad6..d6b2c6d49bd 100644 --- a/src/libcompiler_builtins/lib.rs +++ b/src/libcompiler_builtins/lib.rs @@ -74,7 +74,7 @@ pub mod reimpls { ($a: expr, $b: expr, $ty:ty) => {{ let (a, b) = ($a, $b); let bits = (::core::mem::size_of::<$ty>() * 8) as $ty; - let half_bits = bits / 2; + let half_bits = bits >> 1; if b & half_bits != 0 { <$ty>::from_parts((a.high() >> (b - half_bits)) as <$ty as LargeInt>::LowHalf, a.high() >> (half_bits - 1)) @@ -97,7 +97,7 @@ pub mod reimpls { ($a: expr, $b: expr, $ty:ty) => {{ let (a, b) = ($a, $b); let bits = (::core::mem::size_of::<$ty>() * 8) as $ty; - let half_bits = bits / 2; + let half_bits = bits >> 1; if b & half_bits != 0 { <$ty>::from_parts(a.high() >> (b - half_bits), 0) } else if b == 0 { diff --git a/src/librustc_i128/lib.rs b/src/librustc_i128/lib.rs index a9770396e78..80f550c7f50 100644 --- a/src/librustc_i128/lib.rs +++ b/src/librustc_i128/lib.rs @@ -9,6 +9,7 @@ // except according to those terms. #![allow(non_camel_case_types)] #![cfg_attr(not(stage0), feature(i128_type))] +#![no_std] #![crate_type="rlib"] #![crate_name="rustc_i128"]