Skip to content

Commit d3bb7ee

Browse files
committed
---
yaml --- r: 40644 b: refs/heads/dist-snap c: 6084032 h: refs/heads/master v: v3
1 parent 2e01d1f commit d3bb7ee

30 files changed

+48
-46
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: 7a065f243473ea4ea8dc4653bca33f04a1381122
10+
refs/heads/dist-snap: 608403227075586dfe676916bdce6796eef3d9bb
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/test/auxiliary/cci_class_cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct cat {
1313
}
1414

1515
impl cat : ToStr {
16-
pure fn to_str() -> ~str { self.name }
16+
pure fn to_str() -> ~str { copy self.name }
1717
}
1818

1919
priv impl cat {

branches/dist-snap/src/test/auxiliary/issue-2631-a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ type header_map = HashMap<~str, @DVec<@~str>>;
1212

1313
// the unused ty param is necessary so this gets monomorphized
1414
fn request<T: Copy>(req: header_map) {
15-
let _x = *(*req.get(~"METHOD"))[0u];
15+
let _x = *(copy *req.get(~"METHOD"))[0u];
1616
}

branches/dist-snap/src/test/auxiliary/issue_2242_a.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ trait to_strz {
66
}
77

88
impl ~str: to_strz {
9-
fn to_strz() -> ~str { self }
9+
fn to_strz() -> ~str { copy self }
1010
}

branches/dist-snap/src/test/auxiliary/trait_inheritance_overloading_xc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub struct MyInt {
88
}
99

1010
pub impl MyInt : Add<MyInt, MyInt> {
11-
pure fn add(other: &MyInt) -> MyInt { mi(self.val + other.val) }
11+
pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
1212
}
1313

1414
pub impl MyInt : Sub<MyInt, MyInt> {
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
fn main() {
22
let x = ~{mut a: ~10, b: ~20};
33
match x {
4-
~{ref a, ref b} => { assert **a == 10; (*x).a = ~30; assert **a == 30; }
4+
~{a: ref a, b: ref b} => {
5+
assert **a == 10; (*x).a = ~30; assert **a == 30;
6+
}
57
}
68
}

branches/dist-snap/src/test/run-pass/getopts_ref.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99
match getopts(args, opts) {
1010
result::Ok(ref m) =>
1111
assert !opt_present(m, "b"),
12-
result::Err(f) => fail fail_str(f)
12+
result::Err(ref f) => fail fail_str(*f)
1313
};
1414

15-
}
15+
}

branches/dist-snap/src/test/run-pass/issue-2633-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ fn a_val(&&x: ~int, +y: ~int) -> int {
44

55
fn main() {
66
let z = ~22;
7-
a_val(z, z);
7+
a_val(copy z, copy z);
88
}

branches/dist-snap/src/test/run-pass/issue-2633.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ fn nyan(kitty: cat, _kitty_info: kitty_info) {
1717

1818
fn main() {
1919
let mut kitty = cat();
20-
nyan(kitty, {kitty: kitty});
20+
nyan(copy kitty, {kitty: copy kitty});
2121
}

branches/dist-snap/src/test/run-pass/issue-2804.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ fn lookup(table: ~json::Object, key: ~str, default: ~str) -> ~str
1313
{
1414
match table.find(&key)
1515
{
16-
option::Some(std::json::String(s)) =>
16+
option::Some(std::json::String(copy s)) =>
1717
{
18-
s
18+
copy s
1919
}
2020
option::Some(value) =>
2121
{
@@ -33,9 +33,9 @@ fn add_interface(store: int, managed_ip: ~str, data: std::json::Json) -> (~str,
3333
{
3434
match &data
3535
{
36-
&std::json::Object(interface) =>
36+
&std::json::Object(copy interface) =>
3737
{
38-
let name = lookup(interface, ~"ifDescr", ~"");
38+
let name = lookup(copy interface, ~"ifDescr", ~"");
3939
let label = fmt!("%s-%s", managed_ip, name);
4040

4141
(label, bool_value(false))

branches/dist-snap/src/test/run-pass/istr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn test_stack_assign() {
22
let s: ~str = ~"a";
3-
log(debug, s);
3+
log(debug, copy s);
44
let t: ~str = ~"a";
55
assert (s == t);
66
let u: ~str = ~"b";
@@ -39,7 +39,7 @@ fn test_append() {
3939

4040
let mut s = ~"a";
4141
s += ~"b";
42-
log(debug, s);
42+
log(debug, copy s);
4343
assert (s == ~"ab");
4444

4545
let mut s = ~"c";

branches/dist-snap/src/test/run-pass/last-use-corner-cases.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121
// Check that no false positives are found in loops.
2222
let mut q = ~40, p = 10;
2323
loop {
24-
let i = q;
24+
let i = copy q;
2525
p += *i;
2626
if p > 100 { break; }
2727
}

branches/dist-snap/src/test/run-pass/last-use-in-cap-clause.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
fn foo() -> fn@() -> int {
44
let k = ~22;
5-
let _u = {a: k};
5+
let _u = {a: copy k};
66
return fn@(move k) -> int { 22 };
77
}
88

branches/dist-snap/src/test/run-pass/last-use-is-capture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
fn main() {
44
fn invoke(f: fn@()) { f(); }
55
let k = ~22;
6-
let _u = {a: k};
6+
let _u = {a: copy k};
77
invoke(|| log(error, k) )
88
}

branches/dist-snap/src/test/run-pass/morestack6.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fn runtest2(f: fn~(), frame_backoff: u32, last_stk: *u8) -> u32 {
3030
// We switched stacks, go back and try to hit the dynamic linker
3131
frame_backoff
3232
} else {
33-
let frame_backoff = runtest2(f, frame_backoff, curr_stk);
33+
let frame_backoff = runtest2(copy f, frame_backoff, curr_stk);
3434
if frame_backoff > 1u32 {
3535
frame_backoff - 1u32
3636
} else if frame_backoff == 1u32 {

branches/dist-snap/src/test/run-pass/newtype-polymorphic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
enum myvec<X> = ~[X];
22

3-
fn myvec_deref<X: Copy>(mv: myvec<X>) -> ~[X] { return *mv; }
3+
fn myvec_deref<X: Copy>(mv: myvec<X>) -> ~[X] { return copy *mv; }
44

55
fn myvec_elt<X: Copy>(mv: myvec<X>) -> X { return mv[0]; }
66

branches/dist-snap/src/test/run-pass/operator-overloading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ struct Point {
77
}
88

99
impl Point : ops::Add<Point,Point> {
10-
pure fn add(other: &Point) -> Point {
10+
pure fn add(&self, other: &Point) -> Point {
1111
Point {x: self.x + (*other).x, y: self.y + (*other).y}
1212
}
1313
}

branches/dist-snap/src/test/run-pass/rec-auto.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
// Issue #50.
77
fn main() {
88
let x = {foo: ~"hello", bar: ~"world"};
9-
log(debug, x.foo);
10-
log(debug, x.bar);
9+
log(debug, copy x.foo);
10+
log(debug, copy x.bar);
1111
}

branches/dist-snap/src/test/run-pass/ret-break-cont-in-block.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ fn find_pos<T:Eq>(n: T, h: ~[T]) -> Option<uint> {
2222

2323
fn bail_deep(x: ~[~[bool]]) {
2424
let mut seen = false;
25-
for iter(x) |x| {
26-
for iter(x) |x| {
25+
for iter(copy x) |x| {
26+
for iter(copy x) |x| {
2727
assert !seen;
2828
if x { seen = true; return; }
2929
}

branches/dist-snap/src/test/run-pass/sendfn-generic-fn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ fn make_generic_record<A: Copy, B: Copy>(a: A, b: B) -> pair<A,B> {
1616

1717
fn test05_start(&&f: fn~(&&v: float, &&v: ~str) -> pair<float, ~str>) {
1818
let p = f(22.22f, ~"Hi");
19-
log(debug, p);
19+
log(debug, copy p);
2020
assert p.a == 22.22f;
2121
assert p.b == ~"Hi";
2222

2323
let q = f(44.44f, ~"Ho");
24-
log(debug, q);
24+
log(debug, copy q);
2525
assert q.a == 44.44f;
2626
assert q.b == ~"Ho";
2727
}

branches/dist-snap/src/test/run-pass/shape_intrinsic_tag_then_rec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ fn main() {
2525
let p_: path_ = { global: true, idents: ~[~"hi"], types: ~[t] };
2626
let p: path = { data: p_, span: sp };
2727
let x = { sp: sp, path: p };
28-
log(error, x.path);
29-
log(error, x);
28+
log(error, copy x.path);
29+
log(error, copy x);
3030
}

branches/dist-snap/src/test/run-pass/stat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ fn main() {
88

99
{
1010
match io::file_writer(&path, [io::Create, io::Truncate]) {
11-
Err(e) => fail e,
11+
Err(copy e) => fail e,
1212
Ok(f) => {
1313
for uint::range(0, 1000) |_i| {
1414
f.write_u8(0);

branches/dist-snap/src/test/run-pass/str-append.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ extern mod std;
66
fn test1() {
77
let mut s: ~str = ~"hello";
88
s += ~"world";
9-
log(debug, s);
9+
log(debug, copy s);
1010
assert (s[9] == 'd' as u8);
1111
}
1212

@@ -16,8 +16,8 @@ fn test2() {
1616
let ff: ~str = ~"abc";
1717
let a: ~str = ff + ~"ABC" + ff;
1818
let b: ~str = ~"ABC" + ff + ~"ABC";
19-
log(debug, a);
20-
log(debug, b);
19+
log(debug, copy a);
20+
log(debug, copy b);
2121
assert (a == ~"abcABCabc");
2222
assert (b == ~"ABCabcABC");
2323
}

branches/dist-snap/src/test/run-pass/str-concat.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ fn main() {
66
let a: ~str = ~"hello";
77
let b: ~str = ~"world";
88
let s: ~str = a + b;
9-
log(debug, s);
9+
log(debug, copy s);
1010
assert (s[9] == 'd' as u8);
1111
}

branches/dist-snap/src/test/run-pass/syntax-extension-fmt.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
extern mod std;
22

33
fn test(actual: ~str, expected: ~str) {
4-
log(debug, actual);
5-
log(debug, expected);
4+
log(debug, copy actual);
5+
log(debug, copy expected);
66
assert (actual == expected);
77
}
88

@@ -249,4 +249,4 @@ fn more_floats() {
249249
assert ~"99" == fmt!("%.0f", 98.5);
250250
assert ~"7.0000" == fmt!("%.4f", 6.999999999);
251251
assert ~"3.141590000" == fmt!("%.9f", 3.14159);
252-
}
252+
}

branches/dist-snap/src/test/run-pass/trait-inheritance-overloading.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ trait MyNum : Add<self,self>, Sub<self,self>, Mul<self,self>, Eq { }
55
struct MyInt { val: int }
66

77
impl MyInt : Add<MyInt, MyInt> {
8-
pure fn add(other: &MyInt) -> MyInt { mi(self.val + other.val) }
8+
pure fn add(&self, other: &MyInt) -> MyInt { mi(self.val + other.val) }
99
}
1010

1111
impl MyInt : Sub<MyInt, MyInt> {

branches/dist-snap/src/test/run-pass/unique-assign-copy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ fn main() {
22
let i = ~mut 1;
33
// Should be a copy
44
let mut j;
5-
j = i;
5+
j = copy i;
66
*i = 2;
77
*j = 3;
88
assert *i == 2;
99
assert *j == 3;
10-
}
10+
}

branches/dist-snap/src/test/run-pass/unique-copy-box.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ fn main() unsafe {
55
let i = ~@1;
66
let j = ~@2;
77
let rc1 = refcount(*i);
8-
let j = i;
8+
let j = copy i;
99
let rc2 = refcount(*i);
1010
error!("rc1: %u rc2: %u", rc1, rc2);
1111
assert rc1 + 1u == rc2;
12-
}
12+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
let a = ~[~mut 10];
3-
let b = a;
3+
let b = copy a;
44

55
assert *a[0] == 10;
66
assert *b[0] == 10;
@@ -10,4 +10,4 @@ fn main() {
1010

1111
assert *a[0] == 20;
1212
assert *b[0] == 10;
13-
}
13+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
fn main() {
22
let a = ~[1, 2, 3, 4, 5];
3-
let mut b = ~[a, a];
3+
let mut b = ~[copy a, copy a];
44
b = b + b; // FIXME(#3387)---can't write b += b
55
}

0 commit comments

Comments
 (0)