Skip to content

Commit 90311fc

Browse files
committed
Enable 64-bit checked multiplication on 32-bit
This was just waiting for compiler-rt support, which was added in #12027 Closes #8449
1 parent 9947470 commit 90311fc

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

src/librustc/back/link.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1122,13 +1122,6 @@ fn link_args(sess: Session,
11221122
args.push(~"-Wl,--allow-multiple-definition");
11231123
}
11241124

1125-
// Stack growth requires statically linking a __morestack function
1126-
args.push(~"-lmorestack");
1127-
// compiler-rt contains implementations of low-level LLVM helpers
1128-
// It should go before platform and user libraries, so it has first dibs
1129-
// at resolving symbols that also appear in libgcc.
1130-
args.push(~"-lcompiler-rt");
1131-
11321125
add_local_native_libraries(&mut args, sess);
11331126
add_upstream_rust_crates(&mut args, sess, dylib, tmpdir);
11341127
add_upstream_native_libraries(&mut args, sess);
@@ -1163,6 +1156,13 @@ fn link_args(sess: Session,
11631156
args.push_all(rpath::get_rpath_flags(sess, out_filename));
11641157
}
11651158

1159+
// Stack growth requires statically linking a __morestack function
1160+
args.push(~"-lmorestack");
1161+
// compiler-rt contains implementations of low-level LLVM helpers
1162+
// It should go before platform and user libraries, so it has first dibs
1163+
// at resolving symbols that also appear in libgcc.
1164+
args.push(~"-lcompiler-rt");
1165+
11661166
// Finally add all the linker arguments provided on the command line along
11671167
// with any #[link_args] attributes found inside the crate
11681168
args.push_all(sess.opts.cg.link_args);

src/libstd/num/i64.rs

-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ impl CheckedSub for i64 {
6060
}
6161
}
6262

63-
// FIXME: #8449: should not be disabled on 32-bit
64-
#[cfg(target_word_size = "64")]
6563
impl CheckedMul for i64 {
6664
#[inline]
6765
fn checked_mul(&self, v: &i64) -> Option<i64> {

src/libstd/num/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ pub trait Int: Integer
426426
+ Bitwise
427427
+ CheckedAdd
428428
+ CheckedSub
429-
// + CheckedMul // FIXME #8849: currently not impled on 32-bit
429+
+ CheckedMul
430430
+ CheckedDiv {}
431431

432432
/// Returns the smallest power of 2 greater than or equal to `n`.

src/libstd/num/u64.rs

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ impl CheckedSub for u64 {
4747
}
4848
}
4949

50-
// FIXME: #8449: should not be disabled on 32-bit
51-
#[cfg(target_word_size = "64")]
5250
impl CheckedMul for u64 {
5351
#[inline]
5452
fn checked_mul(&self, v: &u64) -> Option<u64> {

0 commit comments

Comments
 (0)