Skip to content

Commit a67d954

Browse files
committed
---
yaml --- r: 36655 b: refs/heads/try2 c: 01c0971 h: refs/heads/master i: 36653: dc92818 36651: ca1d3a2 36647: deff816 36639: 6f6f6e7 v: v3
1 parent 1d6004c commit a67d954

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: f675b97ddc3d85498473bb4da7f95b8942ebbd81
8+
refs/heads/try2: 01c0971172578ac170b3ae07c35ae416644ca1ef
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try2/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/try2/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)