Skip to content

Commit d850fff

Browse files
committed
---
yaml --- r: 81364 b: refs/heads/snap-stage3 c: 435ca16 h: refs/heads/master v: v3
1 parent 53e517f commit d850fff

File tree

5 files changed

+53
-20
lines changed

5 files changed

+53
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0640ae0ecde3cfbd6611652e19da0d6fde193548
4+
refs/heads/snap-stage3: 435ca16f4fa7bd47c16de693054be5cba5fd4ebb
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/rt/io/buffered.rs

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -187,25 +187,21 @@ impl<W: Writer> Decorator<W> for BufferedWriter<W> {
187187
}
188188
}
189189

190-
// FIXME #9155 this should be a newtype struct
191-
struct InternalBufferedWriter<W> {
192-
inner: BufferedWriter<W>
193-
}
190+
struct InternalBufferedWriter<W>(BufferedWriter<W>);
194191

195192
impl<W: Reader> Reader for InternalBufferedWriter<W> {
196193
fn read(&mut self, buf: &mut [u8]) -> Option<uint> {
197-
self.inner.inner.read(buf)
194+
self.inner.read(buf)
198195
}
199196

200197
fn eof(&mut self) -> bool {
201-
self.inner.inner.eof()
198+
self.inner.eof()
202199
}
203200
}
204201

205202
/// Wraps a Stream and buffers input and output to and from it
206203
///
207204
/// Note that `BufferedStream` will NOT flush its output buffer when dropped.
208-
// FIXME #9155 this should be a newtype struct
209205
pub struct BufferedStream<S> {
210206
priv inner: BufferedReader<InternalBufferedWriter<S>>
211207
}
@@ -214,7 +210,7 @@ impl<S: Stream> BufferedStream<S> {
214210
pub fn with_capacities(reader_cap: uint, writer_cap: uint, inner: S)
215211
-> BufferedStream<S> {
216212
let writer = BufferedWriter::with_capacity(writer_cap, inner);
217-
let internal_writer = InternalBufferedWriter { inner: writer };
213+
let internal_writer = InternalBufferedWriter(writer);
218214
let reader = BufferedReader::with_capacity(reader_cap,
219215
internal_writer);
220216
BufferedStream { inner: reader }
@@ -238,25 +234,25 @@ impl<S: Stream> Reader for BufferedStream<S> {
238234

239235
impl<S: Stream> Writer for BufferedStream<S> {
240236
fn write(&mut self, buf: &[u8]) {
241-
self.inner.inner.inner.write(buf)
237+
self.inner.inner.write(buf)
242238
}
243239

244240
fn flush(&mut self) {
245-
self.inner.inner.inner.flush()
241+
self.inner.inner.flush()
246242
}
247243
}
248244

249245
impl<S: Stream> Decorator<S> for BufferedStream<S> {
250246
fn inner(self) -> S {
251-
self.inner.inner.inner.inner()
247+
self.inner.inner.inner()
252248
}
253249

254250
fn inner_ref<'a>(&'a self) -> &'a S {
255-
self.inner.inner.inner.inner_ref()
251+
self.inner.inner.inner_ref()
256252
}
257253

258254
fn inner_mut_ref<'a>(&'a mut self) -> &'a mut S {
259-
self.inner.inner.inner.inner_mut_ref()
255+
self.inner.inner.inner_mut_ref()
260256
}
261257
}
262258

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub struct Foo<T>(T);
12+
13+
impl<T> Foo<T> {
14+
pub fn new(t: T) -> Foo<T> {
15+
Foo(t)
16+
}
17+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// aux-build:issue_9155.rs
12+
// xfail-fast windows doesn't like the aux-build
13+
14+
extern mod issue_9155;
15+
16+
struct Baz;
17+
18+
fn main() {
19+
issue_9155::Foo::new(Baz);
20+
}

branches/snap-stage3/src/test/run-pass/rtio-processes.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use std::rt::io::pipe::*;
2929
use std::str;
3030

3131
#[test]
32-
#[cfg(unix, not(target_os="android"))]
32+
#[cfg(unix, not(android))]
3333
fn smoke() {
3434
let io = ~[];
3535
let args = ProcessConfig {
@@ -46,7 +46,7 @@ fn smoke() {
4646
}
4747

4848
#[test]
49-
#[cfg(unix, not(target_os="android"))]
49+
#[cfg(unix, not(android))]
5050
fn smoke_failure() {
5151
let io = ~[];
5252
let args = ProcessConfig {
@@ -63,7 +63,7 @@ fn smoke_failure() {
6363
}
6464

6565
#[test]
66-
#[cfg(unix, not(target_os="android"))]
66+
#[cfg(unix, not(android))]
6767
fn exit_reported_right() {
6868
let io = ~[];
6969
let args = ProcessConfig {
@@ -103,7 +103,7 @@ fn run_output(args: ProcessConfig) -> ~str {
103103
}
104104

105105
#[test]
106-
#[cfg(unix, not(target_os="android"))]
106+
#[cfg(unix, not(android))]
107107
fn stdout_works() {
108108
let pipe = PipeStream::new().unwrap();
109109
let io = ~[Ignored, CreatePipe(pipe, false, true)];
@@ -118,7 +118,7 @@ fn stdout_works() {
118118
}
119119

120120
#[test]
121-
#[cfg(unix, not(target_os="android"))]
121+
#[cfg(unix, not(android))]
122122
fn set_cwd_works() {
123123
let pipe = PipeStream::new().unwrap();
124124
let io = ~[Ignored, CreatePipe(pipe, false, true)];
@@ -134,7 +134,7 @@ fn set_cwd_works() {
134134
}
135135

136136
#[test]
137-
#[cfg(unix, not(target_os="android"))]
137+
#[cfg(unix, not(android))]
138138
fn stdin_works() {
139139
let input = PipeStream::new().unwrap();
140140
let output = PipeStream::new().unwrap();

0 commit comments

Comments
 (0)