Skip to content

Commit 8724113

Browse files
committed
---
yaml --- r: 140468 b: refs/heads/try2 c: 7b36e34 h: refs/heads/master v: v3
1 parent 9871c15 commit 8724113

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 4300d4d2fa9d35ac73742c7d815ee157ce0f9c17
8+
refs/heads/try2: 7b36e34c89372b4a159d4ad565ce11d412fbea04
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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/try2/src/test/run-pass/regions-mock-trans-impls.rs

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

0 commit comments

Comments
 (0)