Skip to content

Commit e894f8f

Browse files
committed
---
yaml --- r: 60847 b: refs/heads/auto c: 784a849 h: refs/heads/master i: 60845: 3b5cc10 60843: efe9dc3 60839: dccd3fb 60831: 6710e59 v: v3
1 parent 315d42e commit e894f8f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+424
-404
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1414
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1515
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1616
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
17-
refs/heads/auto: 9c7eb068e5b3b7aed2de8bf9989ae6b106c9599e
17+
refs/heads/auto: 784a8495d211c2195911e0a7ee5bcada931b3d45
1818
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1919
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c

branches/auto/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ then
561561
| cut -d ' ' -f 2)
562562

563563
case $CFG_CLANG_VERSION in
564-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3*)
564+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* )
565565
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
566566
CFG_C_COMPILER="clang"
567567
;;

branches/auto/doc/rust.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,8 @@ as
20332033
=
20342034
~~~~
20352035

2036-
Operators at the same precedence level are evaluated left-to-right.
2036+
Operators at the same precedence level are evaluated left-to-right. [Unary operators](#unary-operator-expressions)
2037+
have the same precedence level and it is stronger than any of the binary operators'.
20372038

20382039
### Grouped expressions
20392040

branches/auto/src/libextra/fun_treemap.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ enum TreeNode<K, V> {
3535
pub fn init<K, V>() -> Treemap<K, V> { @Empty }
3636

3737
/// Insert a value into the map
38-
pub fn insert<K:Eq + Ord,V>(m: Treemap<K, V>, k: K, v: V) -> Treemap<K, V> {
38+
pub fn insert<K:Copy + Eq + Ord,V:Copy>(m: Treemap<K, V>, k: K, v: V) -> Treemap<K, V> {
3939
@match m {
4040
@Empty => Node(@k, @v, @Empty, @Empty),
41-
@Node(kk, vv, left, right) => cond!(
42-
(k < *kk) { Node(kk, vv, insert(left, k, v), right) }
43-
(k == *kk) { Node(kk, @v, left, right) }
44-
_ { Node(kk, vv, left, insert(right, k, v)) }
41+
@Node(@copy kk, vv, left, right) => cond!(
42+
(k < kk) { Node(@kk, vv, insert(left, k, v), right) }
43+
(k == kk) { Node(@kk, @v, left, right) }
44+
_ { Node(@kk, vv, left, insert(right, k, v)) }
4545
)
4646
}
4747
}
@@ -50,8 +50,8 @@ pub fn insert<K:Eq + Ord,V>(m: Treemap<K, V>, k: K, v: V) -> Treemap<K, V> {
5050
pub fn find<K:Eq + Ord,V:Copy>(m: Treemap<K, V>, k: K) -> Option<V> {
5151
match *m {
5252
Empty => None,
53-
Node(kk, v, left, right) => cond!(
54-
(k == *kk) { Some(copy *v) }
53+
Node(@ref kk, @copy v, left, right) => cond!(
54+
(k == *kk) { Some(v) }
5555
(k < *kk) { find(left, k) }
5656
_ { find(right, k) }
5757
)

branches/auto/src/libextra/getopts.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fn is_arg(arg: &str) -> bool {
171171
fn name_str(nm: &Name) -> ~str {
172172
return match *nm {
173173
Short(ch) => str::from_char(ch),
174-
Long(ref s) => copy *s
174+
Long(copy s) => s
175175
};
176176
}
177177

@@ -390,7 +390,7 @@ pub fn opts_present(mm: &Matches, names: &[~str]) -> bool {
390390
* argument
391391
*/
392392
pub fn opt_str(mm: &Matches, nm: &str) -> ~str {
393-
return match opt_val(mm, nm) { Val(s) => s, _ => fail!() };
393+
return match opt_val(mm, nm) { Val(copy s) => s, _ => fail!() };
394394
}
395395

396396
/**
@@ -402,7 +402,7 @@ pub fn opt_str(mm: &Matches, nm: &str) -> ~str {
402402
pub fn opts_str(mm: &Matches, names: &[~str]) -> ~str {
403403
for names.each |nm| {
404404
match opt_val(mm, *nm) {
405-
Val(ref s) => return copy *s,
405+
Val(copy s) => return s,
406406
_ => ()
407407
}
408408
}
@@ -419,7 +419,7 @@ pub fn opts_str(mm: &Matches, names: &[~str]) -> ~str {
419419
pub fn opt_strs(mm: &Matches, nm: &str) -> ~[~str] {
420420
let mut acc: ~[~str] = ~[];
421421
for vec::each(opt_vals(mm, nm)) |v| {
422-
match *v { Val(ref s) => acc.push(copy *s), _ => () }
422+
match *v { Val(copy s) => acc.push(s), _ => () }
423423
}
424424
return acc;
425425
}
@@ -429,7 +429,7 @@ pub fn opt_maybe_str(mm: &Matches, nm: &str) -> Option<~str> {
429429
let vals = opt_vals(mm, nm);
430430
if vec::len::<Optval>(vals) == 0u { return None::<~str>; }
431431
return match vals[0] {
432-
Val(ref s) => Some(copy *s),
432+
Val(copy s) => Some(s),
433433
_ => None
434434
};
435435
}
@@ -445,7 +445,7 @@ pub fn opt_maybe_str(mm: &Matches, nm: &str) -> Option<~str> {
445445
pub fn opt_default(mm: &Matches, nm: &str, def: &str) -> Option<~str> {
446446
let vals = opt_vals(mm, nm);
447447
if vec::len::<Optval>(vals) == 0u { return None::<~str>; }
448-
return match vals[0] { Val(ref s) => Some::<~str>(copy *s),
448+
return match vals[0] { Val(copy s) => Some::<~str>(s),
449449
_ => Some::<~str>(str::to_owned(def)) }
450450
}
451451

@@ -701,7 +701,7 @@ mod tests {
701701
let opts = ~[reqopt("test")];
702702
let rs = getopts(args, opts);
703703
match rs {
704-
Err(f) => check_fail_type(f, OptionMissing_),
704+
Err(copy f) => check_fail_type(f, OptionMissing_),
705705
_ => fail!()
706706
}
707707
}
@@ -712,7 +712,7 @@ mod tests {
712712
let opts = ~[reqopt("test")];
713713
let rs = getopts(args, opts);
714714
match rs {
715-
Err(f) => check_fail_type(f, ArgumentMissing_),
715+
Err(copy f) => check_fail_type(f, ArgumentMissing_),
716716
_ => fail!()
717717
}
718718
}
@@ -723,7 +723,7 @@ mod tests {
723723
let opts = ~[reqopt("test")];
724724
let rs = getopts(args, opts);
725725
match rs {
726-
Err(f) => check_fail_type(f, OptionDuplicated_),
726+
Err(copy f) => check_fail_type(f, OptionDuplicated_),
727727
_ => fail!()
728728
}
729729
}
@@ -748,7 +748,7 @@ mod tests {
748748
let opts = ~[reqopt("t")];
749749
let rs = getopts(args, opts);
750750
match rs {
751-
Err(f) => check_fail_type(f, OptionMissing_),
751+
Err(copy f) => check_fail_type(f, OptionMissing_),
752752
_ => fail!()
753753
}
754754
}
@@ -759,7 +759,7 @@ mod tests {
759759
let opts = ~[reqopt("t")];
760760
let rs = getopts(args, opts);
761761
match rs {
762-
Err(f) => check_fail_type(f, ArgumentMissing_),
762+
Err(copy f) => check_fail_type(f, ArgumentMissing_),
763763
_ => fail!()
764764
}
765765
}
@@ -770,7 +770,7 @@ mod tests {
770770
let opts = ~[reqopt("t")];
771771
let rs = getopts(args, opts);
772772
match rs {
773-
Err(f) => check_fail_type(f, OptionDuplicated_),
773+
Err(copy f) => check_fail_type(f, OptionDuplicated_),
774774
_ => fail!()
775775
}
776776
}
@@ -808,7 +808,7 @@ mod tests {
808808
let opts = ~[optopt("test")];
809809
let rs = getopts(args, opts);
810810
match rs {
811-
Err(f) => check_fail_type(f, ArgumentMissing_),
811+
Err(copy f) => check_fail_type(f, ArgumentMissing_),
812812
_ => fail!()
813813
}
814814
}
@@ -819,7 +819,7 @@ mod tests {
819819
let opts = ~[optopt("test")];
820820
let rs = getopts(args, opts);
821821
match rs {
822-
Err(f) => check_fail_type(f, OptionDuplicated_),
822+
Err(copy f) => check_fail_type(f, OptionDuplicated_),
823823
_ => fail!()
824824
}
825825
}
@@ -855,7 +855,7 @@ mod tests {
855855
let opts = ~[optopt("t")];
856856
let rs = getopts(args, opts);
857857
match rs {
858-
Err(f) => check_fail_type(f, ArgumentMissing_),
858+
Err(copy f) => check_fail_type(f, ArgumentMissing_),
859859
_ => fail!()
860860
}
861861
}
@@ -866,7 +866,7 @@ mod tests {
866866
let opts = ~[optopt("t")];
867867
let rs = getopts(args, opts);
868868
match rs {
869-
Err(f) => check_fail_type(f, OptionDuplicated_),
869+
Err(copy f) => check_fail_type(f, OptionDuplicated_),
870870
_ => fail!()
871871
}
872872
}
@@ -901,7 +901,7 @@ mod tests {
901901
let opts = ~[optflag("test")];
902902
let rs = getopts(args, opts);
903903
match rs {
904-
Err(f) => {
904+
Err(copy f) => {
905905
error!(fail_str(copy f));
906906
check_fail_type(f, UnexpectedArgument_);
907907
}
@@ -915,7 +915,7 @@ mod tests {
915915
let opts = ~[optflag("test")];
916916
let rs = getopts(args, opts);
917917
match rs {
918-
Err(f) => check_fail_type(f, OptionDuplicated_),
918+
Err(copy f) => check_fail_type(f, OptionDuplicated_),
919919
_ => fail!()
920920
}
921921
}
@@ -963,7 +963,7 @@ mod tests {
963963
let opts = ~[optflag("t")];
964964
let rs = getopts(args, opts);
965965
match rs {
966-
Err(f) => check_fail_type(f, OptionDuplicated_),
966+
Err(copy f) => check_fail_type(f, OptionDuplicated_),
967967
_ => fail!()
968968
}
969969
}
@@ -1066,7 +1066,7 @@ mod tests {
10661066
let opts = ~[optmulti("test")];
10671067
let rs = getopts(args, opts);
10681068
match rs {
1069-
Err(f) => check_fail_type(f, ArgumentMissing_),
1069+
Err(copy f) => check_fail_type(f, ArgumentMissing_),
10701070
_ => fail!()
10711071
}
10721072
}
@@ -1119,7 +1119,7 @@ mod tests {
11191119
let opts = ~[optmulti("t")];
11201120
let rs = getopts(args, opts);
11211121
match rs {
1122-
Err(f) => check_fail_type(f, ArgumentMissing_),
1122+
Err(copy f) => check_fail_type(f, ArgumentMissing_),
11231123
_ => fail!()
11241124
}
11251125
}
@@ -1147,7 +1147,7 @@ mod tests {
11471147
let opts = ~[optmulti("t")];
11481148
let rs = getopts(args, opts);
11491149
match rs {
1150-
Err(f) => check_fail_type(f, UnrecognizedOption_),
1150+
Err(copy f) => check_fail_type(f, UnrecognizedOption_),
11511151
_ => fail!()
11521152
}
11531153
}
@@ -1158,7 +1158,7 @@ mod tests {
11581158
let opts = ~[optmulti("test")];
11591159
let rs = getopts(args, opts);
11601160
match rs {
1161-
Err(f) => check_fail_type(f, UnrecognizedOption_),
1161+
Err(copy f) => check_fail_type(f, UnrecognizedOption_),
11621162
_ => fail!()
11631163
}
11641164
}

branches/auto/src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ mod tests {
13841384

13851385
for items.each |item| {
13861386
match *item {
1387-
(ref key, ref value) => { d.insert(copy *key, copy *value); },
1387+
(copy key, copy value) => { d.insert(key, value); },
13881388
}
13891389
};
13901390

branches/auto/src/libextra/list.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn tail<T:Copy>(ls: @List<T>) -> @List<T> {
104104
/// Returns the first element of a list
105105
pub fn head<T:Copy>(ls: @List<T>) -> T {
106106
match *ls {
107-
Cons(ref hd, _) => copy *hd,
107+
Cons(copy hd, _) => hd,
108108
// makes me sad
109109
_ => fail!("head invoked on empty list")
110110
}
@@ -114,9 +114,9 @@ pub fn head<T:Copy>(ls: @List<T>) -> T {
114114
pub fn append<T:Copy>(l: @List<T>, m: @List<T>) -> @List<T> {
115115
match *l {
116116
Nil => return m,
117-
Cons(ref x, xs) => {
117+
Cons(copy x, xs) => {
118118
let rest = append(xs, m);
119-
return @Cons(copy *x, rest);
119+
return @Cons(x, rest);
120120
}
121121
}
122122
}

branches/auto/src/libextra/net_ip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ pub mod v6 {
278278
pub fn parse_addr(ip: &str) -> IpAddr {
279279
match try_parse_addr(ip) {
280280
result::Ok(addr) => addr,
281-
result::Err(err_data) => fail!(copy err_data.err_msg)
281+
result::Err(copy err_data) => fail!(copy err_data.err_msg)
282282
}
283283
}
284284
pub fn try_parse_addr(ip: &str) -> result::Result<IpAddr,ParseAddrErr> {

branches/auto/src/libextra/net_tcp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ pub fn accept(new_conn: TcpNewConnection)
595595
}
596596
// UNSAFE LIBUV INTERACTION END
597597
match result_po.recv() {
598-
Some(err_data) => result::Err(err_data),
598+
Some(copy err_data) => result::Err(err_data),
599599
None => result::Ok(TcpSocket(client_socket_data))
600600
}
601601
}

branches/auto/src/libextra/test.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ pub fn run_tests_console(opts: &TestOpts,
223223
}
224224
TeWait(ref test) => st.out.write_str(
225225
fmt!("test %s ... ", test.name.to_str())),
226-
TeResult(test, result) => {
226+
TeResult(copy test, result) => {
227227
match st.log_out {
228228
Some(f) => write_log(f, copy result, &test),
229229
None => ()
@@ -504,8 +504,9 @@ pub fn filter_tests(
504504
filtered = if opts.filter.is_none() {
505505
filtered
506506
} else {
507-
let filter_str = match opts.filter {
508-
option::Some(ref f) => copy *f,
507+
let filter_str =
508+
match opts.filter {
509+
option::Some(copy f) => f,
509510
option::None => ~""
510511
};
511512
@@ -865,7 +866,7 @@ mod tests {
865866
fn first_free_arg_should_be_a_filter() {
866867
let args = ~[~"progname", ~"filter"];
867868
let opts = match parse_opts(args) {
868-
either::Left(o) => o,
869+
either::Left(copy o) => o,
869870
_ => fail!("Malformed arg in first_free_arg_should_be_a_filter")
870871
};
871872
assert!("filter" == (copy opts.filter).get());
@@ -875,7 +876,7 @@ mod tests {
875876
fn parse_ignored_flag() {
876877
let args = ~[~"progname", ~"filter", ~"--ignored"];
877878
let opts = match parse_opts(args) {
878-
either::Left(o) => o,
879+
either::Left(copy o) => o,
879880
_ => fail!("Malformed arg in parse_ignored_flag")
880881
};
881882
assert!((opts.run_ignored));

branches/auto/src/libextra/time.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,10 @@ priv fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
275275
let mut i = 0u;
276276
let len = strs.len();
277277
while i < len {
278-
match strs[i] { // can't use let due to stage0 bugs
279-
(ref needle, value) => {
280-
if match_str(ss, pos, *needle) {
281-
return Some((value, pos + str::len(*needle)));
282-
}
283-
}
278+
let &(needle, value) = &strs[i];
279+
280+
if match_str(ss, pos, needle) {
281+
return Some((value, pos + str::len(needle)));
284282
}
285283
i += 1u;
286284
}
@@ -1009,7 +1007,7 @@ mod tests {
10091007
== Err(~"Invalid time"));
10101008
10111009
match strptime("Fri Feb 13 15:31:30 2009", format) {
1012-
Err(e) => fail!(e),
1010+
Err(copy e) => fail!(e),
10131011
Ok(ref tm) => {
10141012
assert!(tm.tm_sec == 30_i32);
10151013
assert!(tm.tm_min == 31_i32);
@@ -1029,7 +1027,7 @@ mod tests {
10291027
fn test(s: &str, format: &str) -> bool {
10301028
match strptime(s, format) {
10311029
Ok(ref tm) => tm.strftime(format) == str::to_owned(s),
1032-
Err(e) => fail!(e)
1030+
Err(copy e) => fail!(e)
10331031
}
10341032
}
10351033

0 commit comments

Comments
 (0)