diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-06-13 19:06:47 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-06-13 19:06:47 -0700 |
| commit | 7755018074a7802e47ae61f69f5e2b5364a12eb8 (patch) | |
| tree | 0cc0d7770c01720c0b3d470935d68e4caabea945 /src/libextra | |
| parent | b417bc8511a0a38e73312cee8086ed04eeb21b75 (diff) | |
Revert "std: convert {vec,str}::to_owned to methods."
This fixes the strange random crashes in compile-fail tests. This reverts commit 96cd61ad034cc9e88ab6a7845c3480dbc1ea62f3. Conflicts: src/librustc/driver/driver.rs src/libstd/str.rs src/libsyntax/ext/quote.rs
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/flatpipes.rs | 2 | ||||
| -rw-r--r-- | src/libextra/getopts.rs | 44 | ||||
| -rw-r--r-- | src/libextra/md4.rs | 2 | ||||
| -rw-r--r-- | src/libextra/num/bigint.rs | 2 | ||||
| -rw-r--r-- | src/libextra/stats.rs | 3 | ||||
| -rw-r--r-- | src/libextra/time.rs | 2 |
6 files changed, 28 insertions, 27 deletions
diff --git a/src/libextra/flatpipes.rs b/src/libextra/flatpipes.rs index 36ffbb731c8..c0f619c1b85 100644 --- a/src/libextra/flatpipes.rs +++ b/src/libextra/flatpipes.rs @@ -450,7 +450,7 @@ pub mod flatteners { T: Decodable<D>>( buf: &[u8]) -> T { - let buf = buf.to_owned(); + let buf = vec::to_owned(buf); let buf_reader = @BufReader::new(buf); let reader = buf_reader as @Reader; let mut deser: D = FromReader::from_reader(reader); diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs index 9fe81804bd2..f07a2f0c25b 100644 --- a/src/libextra/getopts.rs +++ b/src/libextra/getopts.rs @@ -345,7 +345,7 @@ pub fn getopts(args: &[~str], opts: &[Opt]) -> Result { } i += 1; } - return Ok(Matches {opts: opts.to_owned(), + return Ok(Matches {opts: vec::to_owned(opts), vals: vals, free: free}); } @@ -447,7 +447,7 @@ pub fn opt_default(mm: &Matches, nm: &str, def: &str) -> Option<~str> { let vals = opt_vals(mm, nm); if vals.is_empty() { return None::<~str>; } return match vals[0] { Val(ref s) => Some::<~str>(copy *s), - _ => Some::<~str>(def.to_owned()) } + _ => Some::<~str>(str::to_owned(def)) } } #[deriving(Eq)] @@ -487,10 +487,10 @@ pub mod groups { desc: &str, hint: &str) -> OptGroup { let len = short_name.len(); assert!(len == 1 || len == 0); - return OptGroup { short_name: short_name.to_owned(), - long_name: long_name.to_owned(), - hint: hint.to_owned(), - desc: desc.to_owned(), + return OptGroup { short_name: str::to_owned(short_name), + long_name: str::to_owned(long_name), + hint: str::to_owned(hint), + desc: str::to_owned(desc), hasarg: Yes, occur: Req}; } @@ -500,10 +500,10 @@ pub mod groups { desc: &str, hint: &str) -> OptGroup { let len = short_name.len(); assert!(len == 1 || len == 0); - return OptGroup {short_name: short_name.to_owned(), - long_name: long_name.to_owned(), - hint: hint.to_owned(), - desc: desc.to_owned(), + return OptGroup {short_name: str::to_owned(short_name), + long_name: str::to_owned(long_name), + hint: str::to_owned(hint), + desc: str::to_owned(desc), hasarg: Yes, occur: Optional}; } @@ -513,10 +513,10 @@ pub mod groups { desc: &str) -> OptGroup { let len = short_name.len(); assert!(len == 1 || len == 0); - return OptGroup {short_name: short_name.to_owned(), - long_name: long_name.to_owned(), + return OptGroup {short_name: str::to_owned(short_name), + long_name: str::to_owned(long_name), hint: ~"", - desc: desc.to_owned(), + desc: str::to_owned(desc), hasarg: No, occur: Optional}; } @@ -526,10 +526,10 @@ pub mod groups { desc: &str, hint: &str) -> OptGroup { let len = short_name.len(); assert!(len == 1 || len == 0); - return OptGroup {short_name: short_name.to_owned(), - long_name: long_name.to_owned(), - hint: hint.to_owned(), - desc: desc.to_owned(), + return OptGroup {short_name: str::to_owned(short_name), + long_name: str::to_owned(long_name), + hint: str::to_owned(hint), + desc: str::to_owned(desc), hasarg: Maybe, occur: Optional}; } @@ -542,10 +542,10 @@ pub mod groups { desc: &str, hint: &str) -> OptGroup { let len = short_name.len(); assert!(len == 1 || len == 0); - return OptGroup {short_name: short_name.to_owned(), - long_name: long_name.to_owned(), - hint: hint.to_owned(), - desc: desc.to_owned(), + return OptGroup {short_name: str::to_owned(short_name), + long_name: str::to_owned(long_name), + hint: str::to_owned(hint), + desc: str::to_owned(desc), hasarg: Yes, occur: Multi}; } @@ -654,7 +654,7 @@ pub mod groups { row }); - return brief.to_owned() + + return str::to_owned(brief) + "\n\nOptions:\n" + rows.connect("\n") + "\n\n"; diff --git a/src/libextra/md4.rs b/src/libextra/md4.rs index 94793804bb1..6c972a313c4 100644 --- a/src/libextra/md4.rs +++ b/src/libextra/md4.rs @@ -29,7 +29,7 @@ pub fn md4(msg: &[u8]) -> Quad { let orig_len: u64 = (msg.len() * 8u) as u64; // pad message - let mut msg = vec::append(msg.to_owned(), [0x80u8]); + let mut msg = vec::append(vec::to_owned(msg), [0x80u8]); let mut bitlen = orig_len + 8u64; while (bitlen + 64u64) % 512u64 > 0u64 { msg.push(0u8); diff --git a/src/libextra/num/bigint.rs b/src/libextra/num/bigint.rs index 8c2615de26b..4baa8877bda 100644 --- a/src/libextra/num/bigint.rs +++ b/src/libextra/num/bigint.rs @@ -564,7 +564,7 @@ impl BigUint { /// Creates and initializes an BigUint. pub fn from_slice(slice: &[BigDigit]) -> BigUint { - return BigUint::new(slice.to_owned()); + return BigUint::new(vec::to_owned(slice)); } /// Creates and initializes an BigUint. diff --git a/src/libextra/stats.rs b/src/libextra/stats.rs index 17bdf6c3a1d..88b2fddb9d9 100644 --- a/src/libextra/stats.rs +++ b/src/libextra/stats.rs @@ -16,6 +16,7 @@ use core::iterator::*; use core::f64; use core::cmp; use core::num; +use core::vec; use sort; // NB: this can probably be rewritten in terms of num::Num @@ -56,7 +57,7 @@ impl<'self> Stats for &'self [f64] { fn median(self) -> f64 { assert!(self.len() != 0); - let mut tmp = self.to_owned(); + let mut tmp = vec::to_owned(self); sort::tim_sort(tmp); if tmp.len() & 1 == 0 { let m = tmp.len() / 2; diff --git a/src/libextra/time.rs b/src/libextra/time.rs index 8b754f8c560..caaa2994405 100644 --- a/src/libextra/time.rs +++ b/src/libextra/time.rs @@ -1029,7 +1029,7 @@ mod tests { fn test(s: &str, format: &str) -> bool { match strptime(s, format) { - Ok(ref tm) => tm.strftime(format) == s.to_owned(), + Ok(ref tm) => tm.strftime(format) == str::to_owned(s), Err(e) => fail!(e) } } |
