Skip to content

Commit feae79e

Browse files
committed
---
yaml --- r: 58771 b: refs/heads/try c: 7b36e34 h: refs/heads/master i: 58769: 4500a30 58767: be56f3a v: v3
1 parent 87db978 commit feae79e

File tree

6 files changed

+46
-60
lines changed

6 files changed

+46
-60
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: c081ffbd1e845687202a975ea2e698b623e5722f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 213f7b24ccd9a6833af7e1a329c5e7ffc8f9e3d2
5-
refs/heads/try: 4300d4d2fa9d35ac73742c7d815ee157ce0f9c17
5+
refs/heads/try: 7b36e34c89372b4a159d4ad565ce11d412fbea04
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/resolve.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4825,10 +4825,12 @@ pub impl Resolver {
48254825

48264826
expr_loop(_, Some(label)) => {
48274827
do self.with_label_rib {
4828-
let this = &mut *self;
4829-
let def_like = dl_def(def_label(expr.id));
4830-
let rib = this.label_ribs[this.label_ribs.len() - 1];
4831-
rib.bindings.insert(label, def_like);
4828+
{
4829+
let this = &mut *self;
4830+
let def_like = dl_def(def_label(expr.id));
4831+
let rib = this.label_ribs[this.label_ribs.len() - 1];
4832+
rib.bindings.insert(label, def_like);
4833+
}
48324834

48334835
visit_expr(expr, (), visitor);
48344836
}

branches/try/src/libsyntax/ext/pipes/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use ext::pipes::proto::{protocol_};
4242

4343
use std::bitv::Bitv;
4444

45-
pub fn analyze(proto: &mut protocol_, _cx: @ext_ctxt) {
45+
pub fn analyze(proto: @mut protocol_, _cx: @ext_ctxt) {
4646
debug!("initializing colive analysis");
4747
let num_states = proto.num_states();
4848
let mut colive = do (copy proto.states).map_to_vec |state| {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// error-pattern:borrowed
2+
3+
// Test that if you imm borrow then mut borrow it fails.
4+
5+
fn add1(a:@mut int)
6+
{
7+
add2(a); // already frozen
8+
}
9+
10+
fn add2(_:&mut int)
11+
{
12+
}
13+
14+
pub fn main()
15+
{
16+
let a = @mut 3;
17+
let b = &*a; // freezes a
18+
add1(a);
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// error-pattern:borrowed
2+
3+
// Test that if you mut borrow then imm borrow it fails.
4+
5+
fn add1(a:@mut int)
6+
{
7+
add2(a); // already frozen
8+
}
9+
10+
fn add2(_:&int)
11+
{
12+
}
13+
14+
pub fn main()
15+
{
16+
let a = @mut 3;
17+
let b = &mut *a; // freezes a
18+
add1(a);
19+
}

branches/try/src/test/run-pass/regions-mock-trans-impls.rs

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)