Skip to content

Commit c3168b0

Browse files
committed
---
yaml --- r: 162231 b: refs/heads/auto c: f7d18b9 h: refs/heads/master i: 162229: af15856 162227: 021a44a 162223: bd98561 v: v3
1 parent 1ac4a43 commit c3168b0

File tree

7 files changed

+43
-71
lines changed

7 files changed

+43
-71
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 4ef16741e355754abd446acbd80e5afb784864c7
13+
refs/heads/auto: f7d18b92f80e52462a5c086bb47252817e6b1b3d
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcore/ops.rs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -832,53 +832,3 @@ impl<F,A,R> FnOnce<A,R> for F
832832
self.call_mut(args)
833833
}
834834
}
835-
836-
#[cfg(stage0)]
837-
mod fn_impls {
838-
use super::Fn;
839-
840-
impl<Result> Fn<(),Result> for extern "Rust" fn() -> Result {
841-
#[allow(non_snake_case)]
842-
extern "rust-call" fn call(&self, _args: ()) -> Result {
843-
(*self)()
844-
}
845-
}
846-
847-
impl<Result,A0> Fn<(A0,),Result> for extern "Rust" fn(A0) -> Result {
848-
#[allow(non_snake_case)]
849-
extern "rust-call" fn call(&self, args: (A0,)) -> Result {
850-
let (a0,) = args;
851-
(*self)(a0)
852-
}
853-
}
854-
855-
macro_rules! def_fn(
856-
($($args:ident)*) => (
857-
impl<Result$(,$args)*>
858-
Fn<($($args,)*),Result>
859-
for extern "Rust" fn($($args: $args,)*) -> Result {
860-
#[allow(non_snake_case)]
861-
extern "rust-call" fn call(&self, args: ($($args,)*)) -> Result {
862-
let ($($args,)*) = args;
863-
(*self)($($args,)*)
864-
}
865-
}
866-
)
867-
)
868-
869-
def_fn!(A0 A1)
870-
def_fn!(A0 A1 A2)
871-
def_fn!(A0 A1 A2 A3)
872-
def_fn!(A0 A1 A2 A3 A4)
873-
def_fn!(A0 A1 A2 A3 A4 A5)
874-
def_fn!(A0 A1 A2 A3 A4 A5 A6)
875-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7)
876-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8)
877-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9)
878-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10)
879-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11)
880-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12)
881-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13)
882-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14)
883-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15)
884-
}

branches/auto/src/libstd/io/mem.rs

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -278,20 +278,29 @@ impl<'a> BufWriter<'a> {
278278

279279
impl<'a> Writer for BufWriter<'a> {
280280
#[inline]
281-
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
282-
// return an error if the entire write does not fit in the buffer
283-
let cap = if self.pos >= self.buf.len() { 0 } else { self.buf.len() - self.pos };
284-
if buf.len() > cap {
285-
return Err(IoError {
286-
kind: io::OtherIoError,
287-
desc: "Trying to write past end of buffer",
288-
detail: None
289-
})
281+
fn write(&mut self, src: &[u8]) -> IoResult<()> {
282+
let dst = self.buf[mut self.pos..];
283+
let dst_len = dst.len();
284+
285+
if dst_len == 0 {
286+
return Err(io::standard_error(io::EndOfFile));
290287
}
291288

292-
slice::bytes::copy_memory(self.buf[mut self.pos..], buf);
293-
self.pos += buf.len();
294-
Ok(())
289+
let src_len = src.len();
290+
291+
if dst_len >= src_len {
292+
slice::bytes::copy_memory(dst, src);
293+
294+
self.pos += src_len;
295+
296+
Ok(())
297+
} else {
298+
slice::bytes::copy_memory(dst, src[..dst_len]);
299+
300+
self.pos += dst_len;
301+
302+
Err(io::standard_error(io::ShortWrite(dst_len)))
303+
}
295304
}
296305
}
297306

@@ -302,7 +311,7 @@ impl<'a> Seek for BufWriter<'a> {
302311
#[inline]
303312
fn seek(&mut self, pos: i64, style: SeekStyle) -> IoResult<()> {
304313
let new = try!(combine(style, self.pos, self.buf.len(), pos));
305-
self.pos = new as uint;
314+
self.pos = min(new as uint, self.buf.len());
306315
Ok(())
307316
}
308317
}
@@ -419,7 +428,7 @@ mod test {
419428

420429
#[test]
421430
fn test_buf_writer() {
422-
let mut buf = [0 as u8, ..8];
431+
let mut buf = [0 as u8, ..9];
423432
{
424433
let mut writer = BufWriter::new(&mut buf);
425434
assert_eq!(writer.tell(), Ok(0));
@@ -431,9 +440,10 @@ mod test {
431440
writer.write(&[]).unwrap();
432441
assert_eq!(writer.tell(), Ok(8));
433442

434-
assert!(writer.write(&[1]).is_err());
443+
assert_eq!(writer.write(&[8, 9]).unwrap_err().kind, io::ShortWrite(1));
444+
assert_eq!(writer.write(&[10]).unwrap_err().kind, io::EndOfFile);
435445
}
436-
let b: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7];
446+
let b: &[_] = &[0, 1, 2, 3, 4, 5, 6, 7, 8];
437447
assert_eq!(buf.as_slice(), b);
438448
}
439449

@@ -474,7 +484,7 @@ mod test {
474484

475485
match writer.write(&[0, 0]) {
476486
Ok(..) => panic!(),
477-
Err(e) => assert_eq!(e.kind, io::OtherIoError),
487+
Err(e) => assert_eq!(e.kind, io::ShortWrite(1)),
478488
}
479489
}
480490

branches/auto/src/libsyntax/parse/lexer/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ impl<'a> StringReader<'a> {
764764
}
765765
}
766766

767-
// SNAP c9f6d69
767+
// SNAP 361baab
768768
#[allow(unused)]
769769
fn old_escape_warning(&mut self, sp: Span) {
770770
self.span_diagnostic
@@ -797,15 +797,15 @@ impl<'a> StringReader<'a> {
797797
self.scan_unicode_escape(delim)
798798
} else {
799799
let res = self.scan_hex_digits(4u, delim, false);
800-
// SNAP c9f6d69
800+
// SNAP 361baab
801801
//let sp = codemap::mk_sp(escaped_pos, self.last_pos);
802802
//self.old_escape_warning(sp);
803803
res
804804
}
805805
}
806806
'U' if !ascii_only => {
807807
let res = self.scan_hex_digits(8u, delim, false);
808-
// SNAP c9f6d69
808+
// SNAP 361baab
809809
//let sp = codemap::mk_sp(escaped_pos, self.last_pos);
810810
//self.old_escape_warning(sp);
811811
res

branches/auto/src/snapshots.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
S 2014-12-05 361baab
2+
freebsd-x86_64 73cbae4168538a07facd81cca45ed672badb7c3a
3+
linux-i386 211cf0fbdbc7045b765e7b92d92049bbe6788513
4+
linux-x86_64 f001cec306fc1ac77504884acf5dac2e7b39e164
5+
macos-i386 751dc02fac96114361c56eb45ce52e7a58d555e0
6+
macos-x86_64 58cad0275d7b33412501d7dd3386b924d2304e83
7+
winnt-i386 872c56b88cebd7d590fd00bcbd264f0003b4427b
8+
winnt-x86_64 2187d8b3187c03f95cd4e56a582f55ec0cfa8df9
9+
110
S 2014-11-21 c9f6d69
211
freebsd-x86_64 0ef316e7c369177de043e69e964418bd637cbfc0
312
linux-i386 c8342e762a1720be939ed7c6a39bdaa27892f66f

branches/auto/src/test/run-pass/issue-16671.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-android seems to block forever
12+
1113
#![forbid(warnings)]
1214

1315
// Pretty printing tests complain about `use std::predule::*`

branches/auto/src/test/run-pass/wait-forked-but-failed-child.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// ignore-test
1112

1213
extern crate libc;
1314

0 commit comments

Comments
 (0)