Skip to content

Commit 7b47a2c

Browse files
committed
---
yaml --- r: 35462 b: refs/heads/master c: 01c0971 h: refs/heads/master v: v3
1 parent c5f6dee commit 7b47a2c

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,5 +1,5 @@
11
---
2-
refs/heads/master: f675b97ddc3d85498473bb4da7f95b8942ebbd81
2+
refs/heads/master: 01c0971172578ac170b3ae07c35ae416644ca1ef
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024

trunk/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
}

trunk/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)