about summary refs log tree commit diff
path: root/src/libstd/io
AgeCommit message (Collapse)AuthorLines
2018-08-01Implement custom read_to_end for io::Takeljedrz-3/+16
2018-07-30Remove unstable and deprecated APIsSimon Sapin-214/+0
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-14/+14
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-26State default capacity for BufReader/BufWriterJonathan Behrens-2/+4
2018-07-25Merge remote-tracking branches 'ljedrz/dyn_libcore', 'ljedrz/dyn_libstd' and ↵Tatsuyuki Ishi-14/+14
'ljedrz/dyn_libterm' into dyn-rollup
2018-07-19Cursor: update docs to clarify Cursor only works with in-memory buffersTommi Komulainen-8/+9
Reduce misconceptions about Cursor being more general than it really is. Fixes: #52470
2018-07-11simplify assertionsAndy Russell-5/+4
2018-07-11Add missing dyn in testsljedrz-1/+1
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-13/+13
2018-07-08rework `LineWriter` exampleAndy Russell-10/+24
The original example didn't check the return value of `write()`, didn't flush the writer, and didn't properly demonstrate the buffering. Fixes #51621.
2018-07-03Rollup merge of #51973 - estk:master, r=abonanderPietro Albini-0/+22
Make Stdio handle UnwindSafe Closes #51863 This is my first compiler PR. Thanks Niko for the mentor help! r? @nikomatsakis
2018-07-03Auto merge of #51564 - SimonSapin:try-int, r=alexcrichtonbors-18/+2
Implement always-fallible TryFrom for usize/isize conversions that are infallible on some platforms This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a "Remove TryFrom impls that might become conditionally-infallible with a portability lint". This fixes #49415 by adding (restoring) missing `TryFrom` impls for integer conversions to or from `usize` or `isize`, by making them always fallible at the type system level (that is, with `Error=TryFromIntError`) even though they happen to be infallible on some platforms (for some values of `size_of::<usize>()`). They had been removed to allow the possibility to conditionally having some of them be infallible `From` impls instead, depending on the platforms, and have the [portability lint](https://github.com/rust-lang/rfcs/pull/1868) warn when they are used in code that is not already opting into non-portability. For example `#[allow(some_lint)] usize::from(x: u64)` would be valid on code that only targets 64-bit platforms. This PR gives up on this possiblity for two reasons: * Based on discussion with @aturon, it seems that the portability lint is not happening any time soon. It’s better to have the conversions be available *at all* than keep blocking them for so long. Portability-lint-gated platform-specific APIs can always be added separately later. * For code that is fine with fallibility, the alternative would force it to opt into "non-portability" even though there would be no real portability issue.
2018-07-02Make Stdio handle UnwindSafeEvan Simmons-0/+22
2018-06-19Remove erroneous example of main as a non-Result function.Sgeo-1/+1
2018-06-17libstd: add an RAII utility for sys_common::mutex::MutexNODA, Kai-10/+11
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2018-06-06Revert "Remove TryFrom impls that might become conditionally-infallible with ↵Simon Sapin-18/+2
a portability lint" This reverts commit 837d6c70233715a0ae8e15c703d40e3046a2f36a. Fixes https://github.com/rust-lang/rust/issues/49415
2018-04-15Deprecate Read::chars and char::decode_utf8Simon Sapin-1/+17
Per FCP: * https://github.com/rust-lang/rust/issues/27802#issuecomment-377537778 * https://github.com/rust-lang/rust/issues/33906#issuecomment-377534308
2018-04-05Stabilize take_set_limitThayne McCombs-2/+1
Fixes #42781
2018-04-05Rollup merge of #49594 - mbrubeck:docs, r=steveklabnikkennytm-0/+22
Add some performance guidance to std::fs and std::io docs Adds more documentation about performance to various "read" functions in `fs` and `io`, and to `BufReader`/`BufWriter`, with the goal of helping developers choose the best option for a given task.
2018-04-03Add performance notes to BufReader/BufWriter docsMatt Brubeck-0/+12
2018-04-03Cross-reference fs::read functions from io::Read docsMatt Brubeck-0/+10
2018-04-02Fix typoRolf van de Krol-1/+1
2018-03-28Auto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, ↵bors-473/+472
r=GuillaumeGomez Remove hidden `foo` functions from doc examples; use `Termination` trait. Fixes https://github.com/rust-lang/rust/issues/49233. Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-473/+472
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-27Remove TryFrom impls that might become conditionally-infallible with a ↵Simon Sapin-2/+18
portability lint https://github.com/rust-lang/rust/pull/49305#issuecomment-376293243
2018-03-18Add BufReader::bufferSteven Fackler-1/+29
This subsumes the need for an explicit is_empty function, and provides access to the buffered data itself which has been requested from time to time.
2018-03-01Fix a bug introduced in previous commitStjepan Glavina-2/+2
2018-02-28Remove thread_local_stateStjepan Glavina-20/+19
2018-02-28Stabilize LocalKey::try_withStjepan Glavina-1/+4
2018-02-19Add missing linkAndreas Streichardt-0/+2
2018-02-18Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkorGuillaume Gomez-1/+1
fix more typos found by codespell.
2018-02-17fix more typos found by codespell.Matthias Krüger-1/+1
2018-02-17Rollup merge of #48234 - zombiezen:patch-1, r=steveklabnikGuillaume Gomez-2/+0
Remove "empty buffer" doc in read_until This appears copied from fill_buf, but the above paragraph already indicates that a lack of delimiter at the end is EOF.
2018-02-15Remove "empty buffer" doc in read_untilRoss Light-2/+0
This appears copied from fill_buf, but the above paragraph already indicates that a lack of delimiter at the end is EOF.
2018-02-10Correct a few stability attributesOliver Middleton-1/+1
2018-01-30std: use more portable error number in from_raw_os_error docsJames Cowgill-4/+4
On MIPS, error number 98 is not EADDRINUSE (it is EPROTOTYPE). To fix the resulting test failure this causes, use a more portable error number in the example documentation. EINVAL shold be more reliable because it was defined in the original Unix as 22 so hopefully most derivatives have defined it the same way.
2018-01-15Rollup merge of #47330 - bmusin:patch-2, r=shepmasterkennytm-4/+4
fix off-by-one error Fixes https://github.com/rust-lang/rust/issues/47325.
2018-01-15Rollup merge of #47120 - clarcharr:io_error_debug, r=dtolnaykennytm-8/+35
Better Debug impl for io::Error. This PR includes the below changes: 1. The former impl wrapped the entire thing in `Error { repr: ... }` which was unhelpful; this has been removed. 2. The `Os` variant of `io::Error` included the code and message, but not the kind; this has been fixed. 3. The `Custom` variant of `io::Error` included a `Custom(Custom { ... })`, which is now just `Custom { ... }`. Example of previous impl: ```rust Error { repr: Custom( Custom { kind: InvalidData, error: Error { repr: Os { code: 2, message: "no such file or directory" } } } ) } ``` Example of new impl: ```rust Custom { kind: InvalidData, error: Os { code: 2, kind: NotFound, message: "no such file or directory" } } ```
2018-01-14Auto merge of #46832 - Diggsey:bufread-cheaper-seek, r=alexcrichtonbors-0/+46
BufRead: Only flush the internal buffer if seeking outside of it. Fixes #31100 r? @dtolnay
2018-01-13Add note to documentationDiggory Blake-0/+4
2018-01-13Implement "seek_relative"Diggory Blake-0/+42
2018-01-13Better Debug impl for io::Error.Clar Charr-8/+35
2018-01-13fix off-by-one errorBulat Musin-4/+4
2018-01-10Auto merge of #46830 - Diggsey:cursor-vec-mut, r=alexcrichtonbors-32/+58
Implement `Write` for `Cursor<&mut Vec<T>>` Fixes #30132 r? @dtolnay (I'm just going through `feature-accepted` issues I swear 😛)
2018-01-08Add missing linksGuillaume Gomez-7/+14
2018-01-05Clarify appending behavior of 'io::Read::read_to_string()'.Sergio Benitez-1/+1
2018-01-02Document when LineWriter flushes; document errors for into_inner.Corey Farwell-0/+11
Fixes https://github.com/rust-lang/rust/issues/42468.
2017-12-22Rollup merge of #46898 - tspiteri:int-overflow-not-underflow, r=steveklabnikkennytm-1/+1
docs: do not call integer overflows as underflows In the API docs, integer overflow is sometimes called underflow. Underflow is really when the magnitude of a floating-point number is too small so the number underflows to subnormal or zero. With integers it is always overflow, even if the expected result is less than the minimum number that can be represented.
2017-12-21docs: do not call integer overflows as underflowsTrevor Spiteri-1/+1
2017-12-20Fix some rustdoc warningsGuillaume Gomez-2/+3