Skip to content

Commit 885df7a

Browse files
committed
---
yaml --- r: 59015 b: refs/heads/incoming c: 07cd5a8 h: refs/heads/master i: 59013: 8e5f815 59011: 5c06288 59007: e37c663 v: v3
1 parent 19cdbfa commit 885df7a

File tree

17 files changed

+150
-106
lines changed

17 files changed

+150
-106
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: ce9c0225c451c00c3eebe4e496185143a18814b9
9+
refs/heads/incoming: 07cd5a850c0a7990ae78f160e27dc5561580e18f
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/core.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ they contained the following prologue:
6060
// Don't link to core. We are core.
6161
#[no_core];
6262

63+
#[warn(vecs_implicitly_copyable)];
6364
#[deny(non_camel_case_types)];
6465
#[allow(deprecated_mutable_fields)];
6566

branches/incoming/src/libstd/arc.rs

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

499499
let arc_v = p.recv();
500500

501-
let v = copy *arc::get::<~[int]>(&arc_v);
501+
let v = *arc::get::<~[int]>(&arc_v);
502502
assert!(v[3] == 4);
503503
};
504504

branches/incoming/src/libstd/future.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ mod test {
238238
239239
#[test]
240240
fn test_sendable_future() {
241-
let expected = "schlorf";
242-
let f = Cell(do spawn { expected });
241+
let expected = ~"schlorf";
242+
let f = Cell(do spawn { copy expected });
243243
do task::spawn {
244244
let mut f = f.take();
245245
let actual = f.get();

branches/incoming/src/libstd/getopts.rs

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,13 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
229229
let l = args.len();
230230
let mut i = 0;
231231
while i < l {
232-
let cur = copy args[i];
232+
let cur = args[i];
233233
let curlen = cur.len();
234234
if !is_arg(cur) {
235235
free.push(cur);
236236
} else if cur == ~"--" {
237237
let mut j = i + 1;
238-
while j < l { free.push(copy args[j]); j += 1; }
238+
while j < l { free.push(args[j]); j += 1; }
239239
break;
240240
} else {
241241
let mut names;
@@ -248,8 +248,8 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
248248
names = ~[Long(tail)];
249249
} else {
250250
names =
251-
~[Long(copy tail_eq[0])];
252-
i_arg = Some(copy tail_eq[1]);
251+
~[Long(tail_eq[0])];
252+
i_arg = Some(tail_eq[1]);
253253
}
254254
} else {
255255
let mut j = 1;
@@ -266,7 +266,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
266266
interpreted correctly
267267
*/
268268
269-
match find_opt(opts, copy opt) {
269+
match find_opt(opts, opt) {
270270
Some(id) => last_valid_opt_id = Some(id),
271271
None => {
272272
let arg_follows =
@@ -292,7 +292,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
292292
let mut name_pos = 0;
293293
for names.each() |nm| {
294294
name_pos += 1;
295-
let optid = match find_opt(opts, copy *nm) {
295+
let optid = match find_opt(opts, *nm) {
296296
Some(id) => id,
297297
None => return Err(UnrecognizedOption(name_str(nm)))
298298
};
@@ -305,18 +305,18 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
305305
}
306306
Maybe => {
307307
if !i_arg.is_none() {
308-
vals[optid].push(Val((copy i_arg).get()));
308+
vals[optid].push(Val(i_arg.get()));
309309
} else if name_pos < names.len() ||
310310
i + 1 == l || is_arg(args[i + 1]) {
311311
vals[optid].push(Given);
312-
} else { i += 1; vals[optid].push(Val(copy args[i])); }
312+
} else { i += 1; vals[optid].push(Val(args[i])); }
313313
}
314314
Yes => {
315315
if !i_arg.is_none() {
316-
vals[optid].push(Val((copy i_arg).get()));
316+
vals[optid].push(Val(i_arg.get()));
317317
} else if i + 1 == l {
318318
return Err(ArgumentMissing(name_str(nm)));
319-
} else { i += 1; vals[optid].push(Val(copy args[i])); }
319+
} else { i += 1; vals[optid].push(Val(args[i])); }
320320
}
321321
}
322322
}
@@ -346,15 +346,15 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result {
346346
347347
fn opt_vals(mm: &Matches, nm: &str) -> ~[Optval] {
348348
return match find_opt(mm.opts, mkname(nm)) {
349-
Some(id) => copy mm.vals[id],
349+
Some(id) => mm.vals[id],
350350
None => {
351351
error!("No option '%s' defined", nm);
352352
fail!()
353353
}
354354
};
355355
}
356356

357-
fn opt_val(mm: &Matches, nm: &str) -> Optval { copy opt_vals(mm, nm)[0] }
357+
fn opt_val(mm: &Matches, nm: &str) -> Optval { return opt_vals(mm, nm)[0]; }
358358

359359
/// Returns true if an option was matched
360360
pub fn opt_present(mm: &Matches, nm: &str) -> bool {
@@ -547,29 +547,25 @@ pub mod groups {
547547
// translate OptGroup into Opt
548548
// (both short and long names correspond to different Opts)
549549
pub fn long_to_short(lopt: &OptGroup) -> ~[Opt] {
550-
let OptGroup{short_name: short_name,
551-
long_name: long_name,
552-
hasarg: hasarg,
553-
occur: occur,
554-
_} = copy *lopt;
550+
match ((*lopt).short_name.len(),
551+
(*lopt).long_name.len()) {
555552

556-
match (short_name.len(), long_name.len()) {
557553
(0,0) => fail!(~"this long-format option was given no name"),
558554
559-
(0,_) => ~[Opt {name: Long((long_name)),
560-
hasarg: hasarg,
561-
occur: occur}],
555+
(0,_) => ~[Opt {name: Long(((*lopt).long_name)),
556+
hasarg: (*lopt).hasarg,
557+
occur: (*lopt).occur}],
562558
563-
(1,0) => ~[Opt {name: Short(str::char_at(short_name, 0)),
564-
hasarg: hasarg,
565-
occur: occur}],
559+
(1,0) => ~[Opt {name: Short(str::char_at((*lopt).short_name, 0)),
560+
hasarg: (*lopt).hasarg,
561+
occur: (*lopt).occur}],
566562
567-
(1,_) => ~[Opt {name: Short(str::char_at(short_name, 0)),
568-
hasarg: hasarg,
569-
occur: occur},
570-
Opt {name: Long((long_name)),
571-
hasarg: hasarg,
572-
occur: occur}],
563+
(1,_) => ~[Opt {name: Short(str::char_at((*lopt).short_name, 0)),
564+
hasarg: (*lopt).hasarg,
565+
occur: (*lopt).occur},
566+
Opt {name: Long(((*lopt).long_name)),
567+
hasarg: (*lopt).hasarg,
568+
occur: (*lopt).occur}],
573569
574570
(_,_) => fail!(~"something is wrong with the long-form opt")
575571
}
@@ -590,12 +586,11 @@ pub mod groups {
590586
let desc_sep = ~"\n" + str::repeat(~" ", 24);
591587
592588
let rows = vec::map(opts, |optref| {
593-
let OptGroup{short_name: short_name,
594-
long_name: long_name,
595-
hint: hint,
596-
desc: desc,
597-
hasarg: hasarg,
598-
_} = copy *optref;
589+
let short_name = (*optref).short_name;
590+
let long_name = (*optref).long_name;
591+
let hint = (*optref).hint;
592+
let desc = (*optref).desc;
593+
let hasarg = (*optref).hasarg;
599594
600595
let mut row = str::repeat(~" ", 4);
601596
@@ -625,7 +620,7 @@ pub mod groups {
625620
row += if rowlen < 24 {
626621
str::repeat(~" ", 24 - rowlen)
627622
} else {
628-
copy desc_sep
623+
desc_sep
629624
};
630625
631626
// Normalize desc to contain words separated by one space character
@@ -897,7 +892,7 @@ mod tests {
897892
let rs = getopts(args, opts);
898893
match rs {
899894
Err(copy f) => {
900-
error!(fail_str(copy f));
895+
error!(fail_str(f));
901896
check_fail_type(f, UnexpectedArgument_);
902897
}
903898
_ => fail!()

branches/incoming/src/libstd/net_ip.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub mod v4 {
175175
pub fn parse_addr(ip: &str) -> IpAddr {
176176
match try_parse_addr(ip) {
177177
result::Ok(addr) => addr,
178-
result::Err(ref err_data) => fail!(copy err_data.err_msg)
178+
result::Err(ref err_data) => fail!(err_data.err_msg)
179179
}
180180
}
181181
// the simple, old style numberic representation of
@@ -272,7 +272,7 @@ pub mod v6 {
272272
pub fn parse_addr(ip: &str) -> IpAddr {
273273
match try_parse_addr(ip) {
274274
result::Ok(addr) => addr,
275-
result::Err(copy err_data) => fail!(copy err_data.err_msg)
275+
result::Err(copy err_data) => fail!(err_data.err_msg)
276276
}
277277
}
278278
pub fn try_parse_addr(ip: &str) -> result::Result<IpAddr,ParseAddrErr> {

0 commit comments

Comments
 (0)