Skip to content

Commit ab2eaa8

Browse files
committed
---
yaml --- r: 214522 b: refs/heads/beta c: 27d2bd1 h: refs/heads/master v: v3
1 parent 247f6af commit ab2eaa8

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 32fe2e3ad452128d17ab1ce15f2c77b8cb42a3ea
26+
refs/heads/beta: 27d2bd13c357bed328735da8605fce1416acc060
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 8c0aa6d64ebab528f7eb182812007155d6044972
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_trans/trans/consts.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,11 @@ fn const_expr_unadjusted<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
660660
(CastTy::Float, CastTy::Float) => {
661661
llvm::LLVMConstFPCast(v, llty.to_ref())
662662
}
663+
(CastTy::Float, CastTy::Int(IntTy::I)) => {
664+
llvm::LLVMConstFPToSI(v, llty.to_ref())
665+
}
663666
(CastTy::Float, CastTy::Int(_)) => {
664-
if ty::type_is_signed(t_expr) { llvm::LLVMConstFPToSI(v, llty.to_ref()) }
665-
else { llvm::LLVMConstFPToUI(v, llty.to_ref()) }
667+
llvm::LLVMConstFPToUI(v, llty.to_ref())
666668
}
667669
(CastTy::Ptr(_), CastTy::Ptr(_)) | (CastTy::FnPtr, CastTy::Ptr(_))
668670
| (CastTy::RPtr(_), CastTy::Ptr(_)) => {

branches/beta/src/test/run-pass/cast-rfc0401.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ fn main()
7575
assert_eq!(9.223372036854775e18f64 as i64, 0x7ffffffffffffc00i64);
7676
assert_eq!(-9.223372036854776e18f64 as i64, 0x8000000000000000u64 as i64);
7777

78-
7978
// addr-ptr-cast/ptr-addr-cast (thin ptr)
8079
let p: *const [u8; 1] = lsz as *const [u8; 1];
8180
assert_eq!(p as usize, lsz);

0 commit comments

Comments
 (0)