about summary refs log tree commit diff
path: root/src/libstd/io
AgeCommit message (Collapse)AuthorLines
2017-01-22libstd: update std::io module documentation to not mention `try!`Utkarsh Kukreti-3/+1
We're not using it in the examples anymore.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-89/+89
See #38644.
2017-01-13Change `to_owned` to `to_string` in docsStjepan Glavina-2/+2
We should teach conversion from `str` to `String` using `to_string` rather than the legacy `to_owned`.
2016-12-24Rollup merge of #38505 - estebank:why-lines, r=frewsxcvSteve Klabnik-0/+6
Docs: Explain why/when `.lines()` returns an error Fix #37744.
2016-12-24Auto merge of #38062 - alexcrichton:fix-line-writer, r=brsonbors-13/+86
std: Fix partial writes in LineWriter Previously the `LineWriter` could successfully write some bytes but then fail to report that it has done so. Additionally, an erroneous flush after a successful write was permanently ignored. This commit fixes these two issues by (a) maintaining a `need_flush` flag to indicate whether a flush should be the first operation in `LineWriter::write` and (b) avoiding returning an error once some bytes have been successfully written. Closes #37807
2016-12-20Docs: Explain why/when `.lines()` returns an errorEsteban Küber-0/+6
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+79
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-16Address falloutAaron Turon-3/+3
2016-12-15Stabilize std::io::Take::into_innerAaron Turon-3/+1
2016-12-12Merge branch 'master' into redoxJeremy Soller-3/+21
2016-12-12Auto merge of #38049 - frewsxcv:libunicode, r=alexcrichtonbors-1/+1
Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes https://github.com/rust-lang/rust/issues/26554.
2016-11-30Move small-copy optimization into <&[u8] as Read>Ruud van Asseldonk-2/+20
Based on the discussion in https://github.com/rust-lang/rust/pull/37573, it is likely better to keep this limited to std::io, instead of modifying a function which users expect to be a memcpy.
2016-11-30Move small-copy optimization into copy_from_sliceRuud van Asseldonk-15/+3
Ultimately copy_from_slice is being a bottleneck, not io::Cursor::read. It might be worthwhile to move the check here, so more places can benefit from it.
2016-11-30Add small-copy optimization for io::CursorRuud van Asseldonk-3/+15
During benchmarking, I found that one of my programs spent between 5 and 10 percent of the time doing memmoves. Ultimately I tracked these down to single-byte slices being copied with a memcopy in io::Cursor::read(). Doing a manual copy if only one byte is requested can speed things up significantly. For my program, this reduced the running time by 20%. Why special-case only a single byte, and not a "small" slice in general? I tried doing this for slices of at most 64 bytes and of at most 8 bytes. In both cases my test program was significantly slower.
2016-11-30Rename 'librustc_unicode' crate to 'libstd_unicode'.Corey Farwell-1/+1
Fixes #26554.
2016-11-28Move stdout/err flush into sysJeremy Soller-6/+0
2016-11-28std: Fix partial writes in LineWriterAlex Crichton-13/+86
Previously the `LineWriter` could successfully write some bytes but then fail to report that it has done so. Additionally, an erroneous flush after a successful write was permanently ignored. This commit fixes these two issues by (a) maintaining a `need_flush` flag to indicate whether a flush should be the first operation in `LineWriter::write` and (b) avoiding returning an error once some bytes have been successfully written. Closes #37807
2016-11-19Merge branch 'master' into redoxJeremy Soller-1/+4
2016-11-10Merge branch 'master' into redoxJeremy Soller-34/+74
2016-11-10Fixes for stdio and processes on RedoxJeremy Soller-0/+6
2016-11-10Remove one bounds check from BufReaderArthur Silva-1/+4
Otherwise the optimizer can't be sure that pos <= cap. Added a paranoid debug_assert to ensure correctness instead.
2016-11-08Rollup merge of #37588 - GuillaumeGomez:missing_io_urls, r=frewsxcvSteve Klabnik-11/+19
Add missing urls on io structs r? @steveklabnik
2016-11-05Rollup merge of #37537 - GuillaumeGomez:error_kind_doc, r=steveklabnikAlex Crichton-2/+7
Add missing urls for ErrorKind's variants r? @steveklabnik
2016-11-05add missing urls on io structsGuillaume Gomez-11/+19
2016-11-04Auto merge of #37037 - Mark-Simulacrum:stack-error, r=alexcrichtonbors-21/+48
Add conversions from `io:ErrorKind` to `io::Error` Filing to help with discussion around the possibility of doing this. Current changes are clearly backwards incompatible, but I think adding a new function (with a bikeshed on naming) like `Error::new_str` should be possible (or some other way of specializing the string error message case) to fix #36658.
2016-11-02Add missing urls for ErrorKind's variantsGuillaume Gomez-2/+7
2016-11-02Auto merge of #36948 - brson:sys, r=brsonbors-10/+2
More refactoring to obey platform abstraction lint The most interesting things here are moving `std/sys/common` to `std/sys_common`, and `std/num/{f32,f64}.rs` to `std/{f32,f64}.rs`, and adding more documentation to `std/lib.rs`. r? @alexcrichton
2016-11-02Add a new non-heap allocated variant to io::Error's representation.Mark-Simulacrum-21/+48
Implement From<ErrorKind> for io::Error, intended for use with errors that should never be exposed to the user.
2016-11-01std: Move a plattform-specific constant to sys::stdioBrian Anderson-10/+2
2016-11-01Rollup merge of #37316 - ollie27:docs_links, r=GuillaumeGomezGuillaume Gomez-2/+2
Fix a few links in the docs r? @steveklabnik
2016-10-31Changed most vec! invocations to use square bracesiirelu-6/+6
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
2016-10-27Add documentation for Read, Write impls for slices and VecUlrik Sverdrup-0/+11
The Write impls for &[u8] and Vec<u8> are quite different, and we need this to be reflected in the docs. These documentation comments will be visible on the respective type's page in the trait impls section.
2016-10-21Fix a few links in the docsOliver Middleton-2/+2
2016-10-19Rollup merge of #37165 - GuillaumeGomez:bytes_url, r=kmcallisterGuillaume Gomez-6/+12
Add missing urls for io types r? @steveklabnik
2016-10-18Typos in some linkageGuillaume Gomez-41/+52
2016-10-14Rollup merge of #37115 - GuillaumeGomez:buf_reader_urls, r=kmcallisterJonathan Turner-5/+13
add missing urls for BufWriter and BufReader r? @steveklabnik
2016-10-14Add missing urls for io typesGuillaume Gomez-6/+12
2016-10-12Rollup merge of #37089 - GuillaumeGomez:io_urls, r=frewsxcvAlex Crichton-32/+37
Add missing urls in io module r? @steveklabnik
2016-10-12add missing urls for BufWriter and BufReaderGuillaume Gomez-5/+13
2016-10-12Deprecate `Reflect`Nick Cameron-2/+1
[tracking issue](https://github.com/rust-lang/rust/issues/27749)
2016-10-11Add missing urls in io moduleGuillaume Gomez-32/+37
2016-10-05Fixed small typo in `BufRead` commentsRazican-1/+1
`BufRead` comments, in the `Seek` trait implementation, was talking about allocating 8 *ebibytes*. It was a typo, the correct unit is *exbibytes*, since *ebibytes* don't even exist. The calculation is correct, though.
2016-10-04Rollup merge of #36938 - tmiasko:cursor-seek-overflow, r=alexcrichtonManish Goregaokar-7/+18
Check for overflow in Cursor<Vec<u8>>::write. Ensure that cursor position fits into usize, before proceeding with write. Fixes issue #36884.
2016-10-04Rollup merge of #36916 - frewsxcv:patch-1, r=alexcrichtonManish Goregaokar-1/+1
Update unstable attr to reference tracking issue.
2016-10-03Check for overflow in Cursor<Vec<u8>>::write.Tomasz Miąsko-7/+18
Ensure that cursor position fits into usize, before proceeding with write. Fixes issue #36884.
2016-10-02Update unstable attr to reference tracking issue.Corey Farwell-1/+1
2016-10-01std: Move platform specific stdio code into sysBrian Anderson-5/+2
2016-09-30Auto merge of #36339 - brson:emscripten-new, r=alexcrichtonbors-4/+8
Working asmjs and wasm targets This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman. It does a few things: - Updates LLVM with the emscripten [fastcomp](https://github.com/rust-lang/llvm/pull/50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets. - Teaches rustbuild to correctly link C code with emscripten - Updates gcc-rs to work correctly with emscripten - Teaches rustbuild to run crate tests for emscripten with node - Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode - Modifies libtest to run in single-threaded mode for emscripten - Ignores a host of tests that don't work yet, mostly dealing with threads and I/O - Updates libc with wasm32 definitions (presently the same as asmjs) - Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm Notes and caveats: - This is only known to work with `--enable-rustbuild`. - The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node https://github.com/kripken/emscripten/issues/4542, but hello.rs does seem to work when run on node via the binaryen interpreter - This requires an up to date installation of the emscripten sdk from its incoming branch - Unwinding is very broken - When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies. https://github.com/rust-lang/rust/issues/36317 tracks work on this. Fixes https://github.com/rust-lang/rust/issues/36515 Fixes https://github.com/rust-lang/rust/issues/36515 Fixes https://github.com/rust-lang/rust/issues/36356
2016-09-30Change the sigs of set_print/set_panic to allow restoring the default objectsBrian Anderson-4/+4
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+4