Skip to content

Commit 9d01fa8

Browse files
committed
---
yaml --- r: 3182 b: refs/heads/master c: e50c918 h: refs/heads/master v: v3
1 parent b720b82 commit 9d01fa8

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: b84fffaa4e0e672b4653a7832d75a2dc120040aa
2+
refs/heads/master: e50c918e6b35c853813480b5c65c35813ceb6aa1

trunk/src/comp/middle/trans.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,6 +2314,9 @@ fn make_scalar_cmp_glue(&@block_ctxt cx, ValueRef lhs, ValueRef rhs, &ty::t t,
23142314
trans_fail(cx, none[common::span],
23152315
"attempt to compare values of type native");
23162316
}
2317+
case (ty::ty_ptr(_)) {
2318+
f(unsigned_int);
2319+
}
23172320
case (_) {
23182321
// Should never get here, because t is scalar.
23192322

trunk/src/comp/middle/ty.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,7 @@ fn walk_ty(&ctxt cx, ty_walk walker, t ty) {
505505
case (ty_box(?tm)) { walk_ty(cx, walker, tm.ty); }
506506
case (ty_vec(?tm)) { walk_ty(cx, walker, tm.ty); }
507507
case (ty_ivec(?tm)) { walk_ty(cx, walker, tm.ty); }
508+
case (ty_ptr(?tm)) { walk_ty(cx, walker, tm.ty); }
508509
case (ty_port(?subty)) { walk_ty(cx, walker, subty); }
509510
case (ty_chan(?subty)) { walk_ty(cx, walker, subty); }
510511
case (ty_tag(?tid, ?subtys)) {
@@ -2088,6 +2089,27 @@ mod unify {
20882089
case (_) { ret ures_err(terr_mismatch); }
20892090
}
20902091
}
2092+
case (ty::ty_ptr(?expected_mt)) {
2093+
alt (struct(cx.tcx, actual)) {
2094+
case (ty::ty_ptr(?actual_mt)) {
2095+
auto mut;
2096+
alt (unify_mut(expected_mt.mut, actual_mt.mut)) {
2097+
case (none) { ret ures_err(terr_vec_mutability); }
2098+
case (some(?m)) { mut = m; }
2099+
}
2100+
auto result =
2101+
unify_step(cx, expected_mt.ty, actual_mt.ty);
2102+
alt (result) {
2103+
case (ures_ok(?result_sub)) {
2104+
auto mt = rec(ty=result_sub, mut=mut);
2105+
ret ures_ok(mk_ptr(cx.tcx, mt));
2106+
}
2107+
case (_) { ret result; }
2108+
}
2109+
}
2110+
case (_) { ret ures_err(terr_mismatch); }
2111+
}
2112+
}
20912113
case (ty::ty_port(?expected_sub)) {
20922114
alt (struct(cx.tcx, actual)) {
20932115
case (ty::ty_port(?actual_sub)) {

0 commit comments

Comments
 (0)