-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'brson/rt'
Conflicts: src/libcore/rt/context.rs src/libcore/rt/sched.rs src/libcore/rt/thread.rs src/libcore/rt/uv.rs
- Loading branch information
Showing
29 changed files
with
1,815 additions
and
1,086 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use prelude::*; | ||
use super::super::sched::*; | ||
use super::super::rtio::*; | ||
use super::Stream; | ||
|
||
pub struct FileStream; | ||
|
||
pub impl FileStream { | ||
fn new(_path: Path) -> FileStream { | ||
fail!() | ||
} | ||
} | ||
|
||
impl Stream for FileStream { | ||
fn read(&mut self, _buf: &mut [u8]) -> uint { | ||
fail!() | ||
} | ||
|
||
fn eof(&mut self) -> bool { | ||
fail!() | ||
} | ||
|
||
fn write(&mut self, _v: &const [u8]) { | ||
fail!() | ||
} | ||
} | ||
|
||
#[test] | ||
#[ignore] | ||
fn super_simple_smoke_test_lets_go_read_some_files_and_have_a_good_time() { | ||
let message = "it's alright. have a good time"; | ||
let filename = Path("test.txt"); | ||
let mut outstream = FileStream::new(filename); | ||
outstream.write(message.to_bytes()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT | ||
// file at the top-level directory of this distribution and at | ||
// http://rust-lang.org/COPYRIGHT. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
use option::*; | ||
use comm::{GenericPort, GenericChan}; | ||
|
||
pub mod file; | ||
|
||
// FIXME #5370 Strongly want this to be StreamError(&mut Stream) | ||
pub struct StreamError; | ||
|
||
// XXX: Can't put doc comments on macros | ||
// Raised by `Stream` instances on error. Returning `true` from the handler | ||
// indicates that the `Stream` should continue, `false` that it should fail. | ||
condition! { | ||
stream_error: super::StreamError -> bool; | ||
} | ||
|
||
pub trait Stream { | ||
/// Read bytes, up to the length of `buf` and place them in `buf`, | ||
/// returning the number of bytes read or an `IoError`. Reads | ||
/// 0 bytes on EOF. | ||
/// | ||
/// # Failure | ||
/// | ||
/// Raises the `reader_error` condition on error | ||
fn read(&mut self, buf: &mut [u8]) -> uint; | ||
|
||
/// Return whether the Reader has reached the end of the stream | ||
fn eof(&mut self) -> bool; | ||
|
||
/// Write the given buffer | ||
/// | ||
/// # Failure | ||
/// | ||
/// Raises the `writer_error` condition on error | ||
fn write(&mut self, v: &const [u8]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
30d4124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from brson
at brson@30d4124
30d4124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging brson/rust/rt = 30d4124 into auto
30d4124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brson/rust/rt = 30d4124 merged ok, testing candidate = ef282db
30d4124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
http://buildbot.rust-lang.org/builders/auto-linux/builds/600
http://buildbot.rust-lang.org/builders/auto-win/builds/595
http://buildbot.rust-lang.org/builders/auto-mac/builds/608
30d4124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding incoming to auto = ef282db