Skip to content

Commit 3e20462

Browse files
committed
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...)
1 parent 317810d commit 3e20462

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/libcompiler_builtins/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub mod reimpls {
7474
($a: expr, $b: expr, $ty:ty) => {{
7575
let (a, b) = ($a, $b);
7676
let bits = (::core::mem::size_of::<$ty>() * 8) as $ty;
77-
let half_bits = bits / 2;
77+
let half_bits = bits >> 1;
7878
if b & half_bits != 0 {
7979
<$ty>::from_parts((a.high() >> (b - half_bits)) as <$ty as LargeInt>::LowHalf,
8080
a.high() >> (half_bits - 1))
@@ -97,7 +97,7 @@ pub mod reimpls {
9797
($a: expr, $b: expr, $ty:ty) => {{
9898
let (a, b) = ($a, $b);
9999
let bits = (::core::mem::size_of::<$ty>() * 8) as $ty;
100-
let half_bits = bits / 2;
100+
let half_bits = bits >> 1;
101101
if b & half_bits != 0 {
102102
<$ty>::from_parts(a.high() >> (b - half_bits), 0)
103103
} else if b == 0 {

src/librustc_i128/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010
#![allow(non_camel_case_types)]
1111
#![cfg_attr(not(stage0), feature(i128_type))]
12+
#![no_std]
1213
#![crate_type="rlib"]
1314
#![crate_name="rustc_i128"]
1415

0 commit comments

Comments
 (0)