Skip to content

Commit f457272

Browse files
committed
---
yaml --- r: 44505 b: refs/heads/master c: bb833ca h: refs/heads/master i: 44503: 33f32b2 v: v3
1 parent 1219886 commit f457272

File tree

107 files changed

+1714
-549
lines changed

Some content is hidden

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

107 files changed

+1714
-549
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: f34dd565d9316e1a0241512d9c2527ae05d1975e
2+
refs/heads/master: bb833ca0f0e878d381c3dc0c9afe958a810e4427
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/compiletest/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ fn make_run_args(config: config, _props: TestProps, testfile: &Path) ->
570570
};
571571

572572
let args = toolargs + ~[make_exe_name(config, testfile).to_str()];
573-
return ProcArgs {prog: args[0], args: vec::slice(args, 1, args.len())};
573+
return ProcArgs {prog: args[0],
574+
args: vec::slice(args, 1, args.len()).to_vec()};
574575
}
575576

576577
fn split_maybe_args(argstr: Option<~str>) -> ~[~str] {

trunk/src/libcargo/cargo.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub struct Package {
7171
versions: ~[(~str, ~str)]
7272
}
7373

74-
pub impl Package : cmp::Ord {
74+
pub impl cmp::Ord for Package {
7575
pure fn lt(&self, other: &Package) -> bool {
7676
if (*self).name.lt(&(*other).name) { return true; }
7777
if (*other).name.lt(&(*self).name) { return false; }
@@ -1553,7 +1553,7 @@ pub fn cmd_list(c: &Cargo) {
15531553
sync(c);
15541554

15551555
if vec::len(c.opts.free) >= 3u {
1556-
let v = vec::view(c.opts.free, 2u, vec::len(c.opts.free));
1556+
let v = vec::slice(c.opts.free, 2u, vec::len(c.opts.free));
15571557
for vec::each(v) |name| {
15581558
if !valid_pkg_name(*name) {
15591559
error(fmt!("'%s' is an invalid source name", *name));

trunk/src/libcore/at_vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ pub mod traits {
173173
use kinds::Copy;
174174
use ops::Add;
175175

176-
pub impl<T: Copy> @[T] : Add<&[const T],@[T]> {
176+
pub impl<T: Copy> Add<&[const T],@[T]> for @[T] {
177177
#[inline(always)]
178178
pure fn add(&self, rhs: & &self/[const T]) -> @[T] {
179179
append(*self, (*rhs))

trunk/src/libcore/io.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ impl<T: Reader> ReaderUtil for T {
246246
// over-read by reading 1-byte per char needed
247247
nbread = if ncreq > nbreq { ncreq } else { nbreq };
248248
if nbread > 0 {
249-
bytes = vec::slice(bytes, offset, bytes.len());
249+
bytes = vec::slice(bytes, offset, bytes.len()).to_vec();
250250
}
251251
}
252252
chars
@@ -531,7 +531,7 @@ impl Reader for BytesReader {
531531
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
532532
let count = uint::min(len, self.bytes.len() - self.pos);
533533
534-
let view = vec::view(self.bytes, self.pos, self.bytes.len());
534+
let view = vec::slice(self.bytes, self.pos, self.bytes.len());
535535
vec::bytes::copy_memory(bytes, view, count);
536536
537537
self.pos += count;
@@ -1008,7 +1008,7 @@ impl Writer for BytesWriter {
10081008
unsafe { vec::raw::set_len(&mut bytes, count); }
10091009
10101010
{
1011-
let view = vec::mut_view(bytes, self.pos, count);
1011+
let view = vec::mut_slice(bytes, self.pos, count);
10121012
vec::bytes::copy_memory(view, v, v_len);
10131013
}
10141014

trunk/src/libcore/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl num::One for f32 {
282282
static pure fn one() -> f32 { 1.0 }
283283
}
284284

285-
pub impl f32: NumCast {
285+
pub impl NumCast for f32 {
286286
/**
287287
* Cast `n` to an `f32`
288288
*/

trunk/src/libcore/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ impl cmp::Ord for f64 {
297297
pure fn gt(&self, other: &f64) -> bool { (*self) > (*other) }
298298
}
299299

300-
pub impl f64: NumCast {
300+
pub impl NumCast for f64 {
301301
/**
302302
* Cast `n` to an `f64`
303303
*/

trunk/src/libcore/num/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ impl num::One for float {
415415
static pure fn one() -> float { 1.0 }
416416
}
417417
418-
pub impl float: NumCast {
418+
pub impl NumCast for float {
419419
/**
420420
* Cast `n` to a `float`
421421
*/

trunk/src/libcore/num/int-template/i16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod inst {
1717
pub const bits: uint = ::u16::bits;
1818
}
1919

20-
pub impl i16: NumCast {
20+
pub impl NumCast for i16 {
2121
/**
2222
* Cast `n` to a `i16`
2323
*/

trunk/src/libcore/num/int-template/i32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod inst {
1717
pub const bits: uint = ::u32::bits;
1818
}
1919

20-
pub impl i32: NumCast {
20+
pub impl NumCast for i32 {
2121
/**
2222
* Cast `n` to a `i32`
2323
*/

trunk/src/libcore/num/int-template/i64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod inst {
1717
pub const bits: uint = ::u64::bits;
1818
}
1919

20-
pub impl i64: NumCast {
20+
pub impl NumCast for i64 {
2121
/**
2222
* Cast `n` to a `i64`
2323
*/

trunk/src/libcore/num/int-template/i8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ mod inst {
1717
pub const bits: uint = ::u8::bits;
1818
}
1919

20-
pub impl i8: NumCast {
20+
pub impl NumCast for i8 {
2121
/**
2222
* Cast `n` to a `i8`
2323
*/

trunk/src/libcore/num/int-template/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ mod inst {
5858
}
5959
}
6060

61-
pub impl int: NumCast {
61+
pub impl NumCast for int {
6262
/**
6363
* Cast `n` to a `int`
6464
*/

trunk/src/libcore/num/uint-template/u16.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod inst {
1919
pub const bits: uint = 16;
2020
}
2121

22-
pub impl u16: NumCast {
22+
pub impl NumCast for u16 {
2323
/**
2424
* Cast `n` to a `u16`
2525
*/

trunk/src/libcore/num/uint-template/u32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod inst {
1919
pub const bits: uint = 32;
2020
}
2121

22-
pub impl u32: NumCast {
22+
pub impl NumCast for u32 {
2323
/**
2424
* Cast `n` to a `u32`
2525
*/

trunk/src/libcore/num/uint-template/u64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ mod inst {
1919
pub const bits: uint = 64;
2020
}
2121

22-
pub impl u64: num::NumCast {
22+
pub impl NumCast for u64 {
2323
/**
2424
* Cast `n` to a `u64`
2525
*/

trunk/src/libcore/num/uint-template/u8.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod inst {
2626
pub pure fn is_ascii(x: T) -> bool { return 0 as T == x & 128 as T; }
2727
}
2828

29-
pub impl u8: NumCast {
29+
pub impl NumCast for u8 {
3030
/**
3131
* Cast `n` to a `u8`
3232
*/

trunk/src/libcore/num/uint-template/uint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub mod inst {
110110
return true;
111111
}
112112

113-
pub impl uint: iter::Times {
113+
pub impl iter::Times for uint {
114114
#[inline(always)]
115115
/**
116116
* A convenience form for basic iteration. Given a uint `x`,
@@ -209,7 +209,7 @@ pub mod inst {
209209
}
210210
}
211211

212-
pub impl uint: NumCast {
212+
pub impl NumCast for uint {
213213
/**
214214
* Cast `n` to a `uint`
215215
*/

trunk/src/libcore/os.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,21 +108,24 @@ pub mod win32 {
108108
let mut res = None;
109109
let mut done = false;
110110
while !done {
111-
let mut buf = vec::from_elem(n as uint, 0u16);
111+
let mut k: DWORD = 0;
112+
let buf = vec::cast_to_mut(vec::from_elem(n as uint, 0u16));
112113
do vec::as_mut_buf(buf) |b, _sz| {
113-
let k : DWORD = f(b, TMPBUF_SZ as DWORD);
114+
k = f(b, TMPBUF_SZ as DWORD);
114115
if k == (0 as DWORD) {
115116
done = true;
116117
} else if (k == n &&
117118
libc::GetLastError() ==
118119
libc::ERROR_INSUFFICIENT_BUFFER as DWORD) {
119120
n *= (2 as DWORD);
120121
} else {
121-
let sub = vec::slice(buf, 0u, k as uint);
122-
res = option::Some(str::from_utf16(sub));
123122
done = true;
124123
}
125124
}
125+
if k != 0 && done {
126+
let sub = vec::slice(buf, 0u, k as uint);
127+
res = option::Some(str::from_utf16(sub));
128+
}
126129
}
127130
return res;
128131
}

trunk/src/libcore/pipes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,11 +1211,11 @@ pub trait Select2<T: Owned, U: Owned> {
12111211
fn select() -> Either<T, U>;
12121212
}
12131213
1214-
impl<T: Owned, U: Owned,
1214+
impl<T: Owned,
1215+
U: Owned,
12151216
Left: Selectable GenericPort<T>,
12161217
Right: Selectable GenericPort<U>>
1217-
(Left, Right): Select2<T, U> {
1218-
1218+
Select2<T,U> for (Left, Right) {
12191219
fn select() -> Either<T, U> {
12201220
match self {
12211221
(ref lp, ref rp) => match select2i(lp, rp) {

trunk/src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,7 @@ pub trait OwnedStr {
23282328
fn push_char(&mut self, c: char);
23292329
}
23302330

2331-
pub impl ~str : OwnedStr {
2331+
pub impl OwnedStr for ~str {
23322332
fn push_str(&mut self, v: &str) {
23332333
push_str(self, v);
23342334
}

trunk/src/libcore/to_bytes.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl IterBytes for char {
170170
pub mod x32 {
171171
use to_bytes::{Cb, IterBytes};
172172

173-
pub impl uint: IterBytes {
173+
pub impl IterBytes for uint {
174174
#[inline(always)]
175175
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
176176
(*self as u32).iter_bytes(lsb0, f)
@@ -182,7 +182,7 @@ pub mod x32 {
182182
pub mod x64 {
183183
use to_bytes::{Cb, IterBytes};
184184

185-
pub impl uint: IterBytes {
185+
pub impl IterBytes for uint {
186186
#[inline(always)]
187187
pure fn iter_bytes(&self, lsb0: bool, f: Cb) {
188188
(*self as u64).iter_bytes(lsb0, f)

0 commit comments

Comments
 (0)