Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std: Stabilize the io module #23292

Merged
merged 2 commits into from
Mar 13, 2015
Merged

std: Stabilize the io module #23292

merged 2 commits into from
Mar 13, 2015

Conversation

alexcrichton
Copy link
Member

The new std::io module has had some time to bake now, and this commit
stabilizes its functionality. There are still portions of the module which
remain unstable, and below contains a summart of the actions taken.

This commit also deprecates the entire contents of the old_io module in a
blanket fashion. All APIs should now have a reasonable replacement in the
new I/O modules.

Stable APIs:

  • std::io (the name)
  • std::io::prelude (the name)
  • Read
  • Read::read
  • Read::{read_to_end, read_to_string} after being modified to return a usize
    for the number of bytes read.
  • ReadExt
  • Write
  • Write::write
  • Write::{write_all, write_fmt}
  • WriteExt
  • BufRead
  • BufRead::{fill_buf, consume}
  • BufRead::{read_line, read_until} after being modified to return a usize
    for the number of bytes read.
  • BufReadExt
  • BufReader
  • BufReader::{new, with_capacity}
  • BufReader::{get_ref, get_mut, into_inner}
  • {Read,BufRead} for BufReader
  • BufWriter
  • BufWriter::{new, with_capacity}
  • BufWriter::{get_ref, get_mut, into_inner}
  • Write for BufWriter
  • IntoInnerError
  • IntoInnerError::{error, into_inner}
  • {Error,Display} for IntoInnerError
  • LineWriter
  • LineWriter::{new, with_capacity} - with_capacity was added
  • LineWriter::{get_ref, get_mut, into_inner} - get_mut was added)
  • Write for LineWriter
  • BufStream
  • BufStream::{new, with_capacities}
  • BufStream::{get_ref, get_mut, into_inner}
  • {BufRead,Read,Write} for BufStream
  • stdin
  • Stdin
  • Stdin::lock
  • Stdin::read_line - added method
  • StdinLock
  • Read for Stdin
  • {Read,BufRead} for StdinLock
  • stdout
  • Stdout
  • Stdout::lock
  • StdoutLock
  • Write for Stdout
  • Write for StdoutLock
  • stderr
  • Stderr
  • Stderr::lock
  • StderrLock
  • Write for Stderr
  • Write for StderrLock
  • io::Result
  • io::Error
  • io::Error::last_os_error
  • {Display, Error} for Error

Unstable APIs:

(reasons can be found in the commit itself)

  • Write::flush
  • Seek
  • ErrorKind
  • Error::new
  • Error::from_os_error
  • Error::kind

Deprecated APIs

  • Error::description - available via the Error trait
  • Error::detail - available via the Display implementation
  • thread::Builder::{stdout, stderr}

Changes in functionality:

  • old_io::stdio::set_stderr is now a noop as the infrastructure for printing
    backtraces has migrated to std::io.

[breaking-change]

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned brson Mar 11, 2015
@rust-highfive
Copy link
Collaborator

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

Note that in the fallout commit I have duplicated "TTY detection" between libtest and libsyntax as well as a structure to replace Chan{Reader,Writer} in rustc_driver/libtest. The current set_stderr interface is now a noop, but I replaced it with a set_panic hidden function (unstable) in std::io. I don't want to regress functionality in terms of quality of compiler diagnostics as well as test output for now, so we can reconsider the function later on.

@huonw huonw mentioned this pull request Mar 11, 2015
10 tasks
@aturon aturon mentioned this pull request Mar 11, 2015
91 tasks
@alexcrichton alexcrichton force-pushed the stabilize-io branch 12 times, most recently from de59d81 to 0473a27 Compare March 12, 2015 00:54
@bors
Copy link
Contributor

bors commented Mar 12, 2015

☔ The latest upstream changes (presumably #23298) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton alexcrichton force-pushed the stabilize-io branch 2 times, most recently from f5eebbd to b1f2158 Compare March 12, 2015 18:43
@alexcrichton
Copy link
Member Author

I've modified the first commit to remove the FooExt traits by folding functionality with where Self: Sized into the main Read/Write/BufRead traits.

@aturon
Copy link
Member

aturon commented Mar 12, 2015

Really, really exciting. What a long haul!

@bors: r+ b1f2158

@aturon
Copy link
Member

aturon commented Mar 12, 2015

(I left some very minor nits, feel free to fix when it bounces ;-)

@alexcrichton
Copy link
Member Author

@bors: r=aturon 8bf14f7

@bors
Copy link
Contributor

bors commented Mar 12, 2015

☔ The latest upstream changes (presumably #23245) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton
Copy link
Member Author

@bors: r=aturon

@bors
Copy link
Contributor

bors commented Mar 13, 2015

@bors r=aturon 2442589

@bors
Copy link
Contributor

bors commented Mar 13, 2015

⌛ Testing commit 2442589 with merge b3554cb...

@bors
Copy link
Contributor

bors commented Mar 13, 2015

💔 Test failed - auto-mac-64-nopt-t

@alexcrichton
Copy link
Member Author

@bors: r=aturon

On Thu, Mar 12, 2015 at 10:53 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-mac-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4064


Reply to this email directly or view it on GitHub
#23292 (comment).

@bors
Copy link
Contributor

bors commented Mar 13, 2015

@bors r=aturon 2597c05

@bors
Copy link
Contributor

bors commented Mar 13, 2015

⌛ Testing commit 2597c05 with merge a7be711...

@bors
Copy link
Contributor

bors commented Mar 13, 2015

💔 Test failed - auto-mac-32-opt

@alexcrichton
Copy link
Member Author

@bors: r=aturon 981bf5f

@bors
Copy link
Contributor

bors commented Mar 13, 2015

⌛ Testing commit 981bf5f with merge 5f2f914...

@bors
Copy link
Contributor

bors commented Mar 13, 2015

⛄ The build was interrupted to prioritize another pull request.

@bors
Copy link
Contributor

bors commented Mar 13, 2015

⌛ Testing commit 981bf5f with merge 3e4be02...

bors added a commit that referenced this pull request Mar 13, 2015
The new `std::io` module has had some time to bake now, and this commit
stabilizes its functionality. There are still portions of the module which
remain unstable, and below contains a summart of the actions taken.

This commit also deprecates the entire contents of the `old_io` module in a
blanket fashion. All APIs should now have a reasonable replacement in the
new I/O modules.

Stable APIs:

* `std::io` (the name)
* `std::io::prelude` (the name)
* `Read`
* `Read::read`
* `Read::{read_to_end, read_to_string}` after being modified to return a `usize`
  for the number of bytes read.
* `ReadExt`
* `Write`
* `Write::write`
* `Write::{write_all, write_fmt}`
* `WriteExt`
* `BufRead`
* `BufRead::{fill_buf, consume}`
* `BufRead::{read_line, read_until}` after being modified to return a `usize`
  for the number of bytes read.
* `BufReadExt`
* `BufReader`
* `BufReader::{new, with_capacity}`
* `BufReader::{get_ref, get_mut, into_inner}`
* `{Read,BufRead} for BufReader`
* `BufWriter`
* `BufWriter::{new, with_capacity}`
* `BufWriter::{get_ref, get_mut, into_inner}`
* `Write for BufWriter`
* `IntoInnerError`
* `IntoInnerError::{error, into_inner}`
* `{Error,Display} for IntoInnerError`
* `LineWriter`
* `LineWriter::{new, with_capacity}` - `with_capacity` was added
* `LineWriter::{get_ref, get_mut, into_inner}` - `get_mut` was added)
* `Write for LineWriter`
* `BufStream`
* `BufStream::{new, with_capacities}`
* `BufStream::{get_ref, get_mut, into_inner}`
* `{BufRead,Read,Write} for BufStream`
* `stdin`
* `Stdin`
* `Stdin::lock`
* `Stdin::read_line` - added method
* `StdinLock`
* `Read for Stdin`
* `{Read,BufRead} for StdinLock`
* `stdout`
* `Stdout`
* `Stdout::lock`
* `StdoutLock`
* `Write for Stdout`
* `Write for StdoutLock`
* `stderr`
* `Stderr`
* `Stderr::lock`
* `StderrLock`
* `Write for Stderr`
* `Write for StderrLock`
* `io::Result`
* `io::Error`
* `io::Error::last_os_error`
* `{Display, Error} for Error`

Unstable APIs:

(reasons can be found in the commit itself)

* `Write::flush`
* `Seek`
* `ErrorKind`
* `Error::new`
* `Error::from_os_error`
* `Error::kind`

Deprecated APIs

* `Error::description` - available via the `Error` trait
* `Error::detail` - available via the `Display` implementation
* `thread::Builder::{stdout, stderr}`

Changes in functionality:

* `old_io::stdio::set_stderr` is now a noop as the infrastructure for printing
  backtraces has migrated to `std::io`.

[breaking-change]
@bors bors merged commit 981bf5f into rust-lang:master Mar 13, 2015
Ms2ger added a commit to servo/rust-png that referenced this pull request Mar 21, 2015
Ms2ger added a commit to servo/rust-png that referenced this pull request Mar 21, 2015
Ms2ger added a commit to servo/rust-png that referenced this pull request Mar 21, 2015
Ms2ger added a commit to servo/rust-png that referenced this pull request Mar 21, 2015
@alexcrichton alexcrichton deleted the stabilize-io branch March 27, 2015 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants