Skip to content

Commit cbdb75c

Browse files
committed
---
yaml --- r: 12874 b: refs/heads/master c: 19ec5a4 h: refs/heads/master v: v3
1 parent 56d162d commit cbdb75c

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f1a46914c4241c05a5b44f6f8dad4630a150e292
2+
refs/heads/master: 19ec5a41ed98df980357a93d6938dc253106fd9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/trans/base.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2620,11 +2620,16 @@ fn float_cast(bcx: block, lldsttype: TypeRef, llsrctype: TypeRef,
26202620
enum cast_kind { cast_pointer, cast_integral, cast_float,
26212621
cast_enum, cast_other, }
26222622
fn cast_type_kind(t: ty::t) -> cast_kind {
2623-
if ty::type_is_fp(t) { cast_float }
2624-
else if ty::type_is_unsafe_ptr(t) { cast_pointer }
2625-
else if ty::type_is_integral(t) { cast_integral }
2626-
else if ty::type_is_enum(t) { cast_enum }
2627-
else { cast_other }
2623+
alt ty::get(t).struct {
2624+
ty::ty_float(*) {cast_float}
2625+
ty::ty_ptr(*) {cast_pointer}
2626+
ty::ty_rptr(*) {cast_pointer}
2627+
ty::ty_int(*) {cast_integral}
2628+
ty::ty_uint(*) {cast_integral}
2629+
ty::ty_bool {cast_integral}
2630+
ty::ty_enum(*) {cast_enum}
2631+
_ {cast_other}
2632+
}
26282633
}
26292634

26302635

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
let x = 3;
3+
#debug["&x=%x", &x as uint];
4+
}

0 commit comments

Comments
 (0)