Skip to content

Commit c979395

Browse files
committed
---
yaml --- r: 34043 b: refs/heads/snap-stage3 c: 01c0971 h: refs/heads/master i: 34041: c39461c 34039: f9c17b8 v: v3
1 parent 9a415e8 commit c979395

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f675b97ddc3d85498473bb4da7f95b8942ebbd81
4+
refs/heads/snap-stage3: 01c0971172578ac170b3ae07c35ae416644ca1ef
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/alt.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -951,8 +951,18 @@ fn compare_values(cx: block, lhs: ValueRef, rhs: ValueRef, rhs_t: ty::t) ->
951951
scratch_result.val));
952952
return scratch_result.to_result(bcx);
953953
}
954+
ty::ty_estr(_) => {
955+
let scratch_result = scratch_datum(cx, ty::mk_bool(cx.tcx()),
956+
false);
957+
let did = cx.tcx().lang_items.str_eq_fn.get();
958+
let bcx = callee::trans_rtcall_or_lang_call(cx, did,
959+
~[lhs, rhs],
960+
expr::SaveIn(
961+
scratch_result.val));
962+
return scratch_result.to_result(bcx);
963+
}
954964
_ => {
955-
cx.tcx().sess.bug(~"only scalars and unique strings supported in \
965+
cx.tcx().sess.bug(~"only scalars and strings supported in \
956966
compare_values");
957967
}
958968
}

branches/snap-stage3/src/test/run-pass/issue-3574.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// xfail-test
1211
// rustc --test match_borrowed_str.rs.rs && ./match_borrowed_str.rs
1312
extern mod std;
1413

@@ -21,8 +20,8 @@ fn compare(x: &str, y: &str) -> bool
2120
}
2221
}
2322

24-
#[test]
25-
fn tester()
23+
fn main()
2624
{
2725
assert compare("foo", "foo");
26+
assert compare(@"foo", @"foo");
2827
}

0 commit comments

Comments
 (0)