Skip to content

Commit 56c2197

Browse files
committed
---
yaml --- r: 42637 b: refs/heads/try c: bbbb805 h: refs/heads/master i: 42635: 814d994 v: v3
1 parent f1e9e38 commit 56c2197

File tree

5 files changed

+16
-11
lines changed

5 files changed

+16
-11
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: 163b97b7bb53b7a9753b5fbd9b28dc1e09337259
5+
refs/heads/try: bbbb80559c8e321dc023c48579367e2ef1349b4b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,11 @@ impl check_loan_ctxt {
296296
}
297297

298298
match (old_loan.mutbl, new_loan.mutbl) {
299-
(m_const, _) | (_, m_const) |
300-
(m_mutbl, m_mutbl) | (m_imm, m_imm) => {
299+
(m_const, _) | (_, m_const) | (m_imm, m_imm) => {
301300
/*ok*/
302301
}
303302

304-
(m_mutbl, m_imm) | (m_imm, m_mutbl) => {
303+
(m_mutbl, m_mutbl) | (m_mutbl, m_imm) | (m_imm, m_mutbl) => {
305304
self.bccx.span_err(
306305
new_loan.cmt.span,
307306
fmt!("loan of %s as %s \
@@ -418,8 +417,8 @@ impl check_loan_ctxt {
418417

419418
for self.walk_loans_of(ex.id, lp) |loan| {
420419
match loan.mutbl {
421-
m_mutbl | m_const => { /*ok*/ }
422-
m_imm => {
420+
m_const => { /*ok*/ }
421+
m_mutbl | m_imm => {
423422
self.bccx.span_err(
424423
ex.span,
425424
fmt!("%s prohibited due to outstanding loan",

branches/try/src/librustc/middle/borrowck/loan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ impl LoanContext {
251251
// Variant components: the base must be immutable, because
252252
// if it is overwritten, the types of the embedded data
253253
// could change.
254-
do self.loan(cmt_base, m_imm).chain |_ok| {
254+
do self.loan(cmt_base, m_imm).chain |_| {
255255
// can use static, as in loan_stable_comp()
256256
self.issue_loan(cmt, ty::re_static, req_mutbl)
257257
}

branches/try/src/libstd/sort.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -630,9 +630,15 @@ impl<T: Copy Ord> MergeState<T> {
630630
dest -= 1; c2 -= 1; len2 -= 1;
631631
if len2 == 1 { break_outer = true; break; }
632632
633-
let tmp_view = vec::mut_view(tmp, 0, len2);
634-
let count2 = len2 - gallop_left(&const array[c1],
635-
tmp_view, len2-1);
633+
let count2;
634+
{
635+
let tmp_view = vec::mut_view(tmp, 0, len2);
636+
count2 = len2 - gallop_left(&const array[c1],
637+
tmp_view,
638+
len2-1);
639+
// Make tmp_view go out of scope to appease borrowck.
640+
}
641+
636642
if count2 != 0 {
637643
dest -= count2; c2 -= count2; len2 -= count2;
638644
copy_vec(array, dest+1, tmp, c2+1, count2);

branches/try/src/test/run-pass/alt-implicit-copy-unique.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn main() {
1212
let x = ~{mut a: ~10, b: ~20};
1313
match x {
1414
~{a: ref mut a, b: ref b} => {
15-
assert **a == 10; (*x).a = ~30; assert **a == 30;
15+
assert **a == 10; *a = ~30; assert **a == 30;
1616
}
1717
}
1818
}

0 commit comments

Comments
 (0)