Skip to content

Commit d9c81a9

Browse files
committed
---
yaml --- r: 40750 b: refs/heads/dist-snap c: 01c0971 h: refs/heads/master v: v3
1 parent 692342d commit d9c81a9

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
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: f675b97ddc3d85498473bb4da7f95b8942ebbd81
10+
refs/heads/dist-snap: 01c0971172578ac170b3ae07c35ae416644ca1ef
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/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/dist-snap/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)