Skip to content

Commit 975406d

Browse files
committed
---
yaml --- r: 41971 b: refs/heads/master c: bbbb805 h: refs/heads/master i: 41969: 906a8a4 41967: 5ffd98e v: v3
1 parent 859144e commit 975406d

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 163b97b7bb53b7a9753b5fbd9b28dc1e09337259
2+
refs/heads/master: bbbb80559c8e321dc023c48579367e2ef1349b4b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/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",

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

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

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