about summary refs log tree commit diff
path: root/src/libstd/io/stdio.rs
AgeCommit message (Collapse)AuthorLines
2019-04-10std: Add `{read,write}_vectored` for more typesAlex Crichton-1/+50
This commit implements the `{read,write}_vectored` methods on more types in the standard library, namely: * `std::fs::File` * `std::process::ChildStd{in,out,err}` * `std::io::Std{in,out,err}` * `std::io::Std{in,out,err}Lock` * `std::io::Std{in,out,err}Raw` Where supported the OS implementations hook up to native support, otherwise it falls back to the already-defaulted implementation.
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-16/+16
2019-03-28Use write_all instead of write in example codeMatt Brubeck-6/+6
2019-03-08expand unused doc comment diagnosticAndy Russell-2/+2
Report the diagnostic on macro expansions, and add a label indicating why the comment is unused.
2019-02-28Use the correct stderr when testing libstdJethro Beekman-2/+14
2019-02-28libstd => 2018Taiki Endo-15/+15
2019-02-17Use more impl header lifetime elisionScott McMurray-7/+7
There are two big categories of changes in here - Removing lifetimes from common traits that can essentially never user a lifetime from an input (particularly `Drop` & `Debug`) - Forwarding impls that are only possible because the lifetime doesn't matter (like `impl<R: Read + ?Sized> Read for &mut R`) I omitted things that seemed like they could be more controversial, like the handful of iterators that have a `Item: 'static` despite the iterator having a lifetime or the `PartialEq` implementations where the flipped one cannot elide the lifetime.
2019-02-03Improve error message and docs for non-UTF-8 bytes in stdio on WindowsAustin Bonander-0/+45
cc #23344
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07Various minor/cosmetic improvements to codeAlexander Regueiro-2/+2
2018-08-31Implement the `min_const_fn` feature gateOliver Schneider-8/+12
2018-08-06make Lazy::new unsafe and check reentrancy condition in the callersRalf Jung-3/+7
2018-07-10Deny bare trait objects in `src/libstd`.ljedrz-4/+4
2018-07-02Make Stdio handle UnwindSafeEvan Simmons-0/+22
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-53/+53
Fixes https://github.com/rust-lang/rust/issues/49233.
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
2017-11-08std: Change how EBADF is handled in `sys`Alex Crichton-3/+1
This commit removes the reexport of `EBADF_ERR` as a constant from libstd's portability facade, instead opting for a platform-specific function that specifically queries an `io::Error`. Not all platforms may have a constant for this, so it makes the intent a little more clear that a code need not be supplied, just an answer to a query.
2017-06-20Add `Read::initializer`.Steven Fackler-11/+12
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
2017-05-10Fix up stability annotations per feedback.Zack Weinberg-2/+2
2017-05-10Revise the eprint(ln)! feature.Zack Weinberg-50/+29
* Factor out the nigh-identical bodies of `_print` and `_eprint` to a helper function `print_to` (I was sorely tempted to call it `_doprnt`). * Update the issue number for the unstable `eprint` feature. * Add entries to the "unstable book" for `eprint` and `eprint_internal`. * Style corrections to the documentation.
2017-05-10Add `eprint!` and `eprintln!` macros to the prelude.Zack Weinberg-0/+36
These are exactly the same as `print!` and `println!` except that they write to stderr instead of stdout. Issue #39228.
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-2/+2
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-01-29Fix a few impl stability attributesOliver Middleton-6/+6
The versions show up in rustdoc.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-9/+9
See #38644.
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+42
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-11-28Move stdout/err flush into sysJeremy Soller-6/+0
2016-11-10Merge branch 'master' into redoxJeremy Soller-1/+2
2016-11-10Fixes for stdio and processes on RedoxJeremy Soller-0/+6
2016-11-05add missing urls on io structsGuillaume Gomez-1/+2
2016-11-01std: Move a plattform-specific constant to sys::stdioBrian Anderson-9/+1
2016-10-01std: Move platform specific stdio code into sysBrian Anderson-5/+2
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/+1
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-1/+0
2016-07-30Add doc example for StdoutGuillaume Gomez-0/+15
2016-07-30Add doc example for StdinGuillaume Gomez-0/+15
2016-07-30Add doc example for io::StderrGuillaume Gomez-0/+15
2016-03-23doc: Stdin is locked for reads, not writesBrian Anderson-2/+2
2016-03-10Fixup stout/stderr on WindowsOliver Middleton-19/+2
WriteConsoleW can fail if called with a large buffer so we need to slice any stdout/stderr output. However the current slicing has a few problems: 1. It slices by byte but still expects valid UTF-8. 2. The slicing happens even when not outputting to a console. 3. panic! output is not sliced. This fixes these issues by moving the slice to right before WriteConsoleW and slicing on a char boundary.
2016-03-08std: Funnel read_to_end through to one locationAlex Crichton-2/+10
This pushes the implementation detail of proxying `read_to_end` through to `read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle` implementations on Unix/Windows. This way intermediate layers will also be able to take advantage of this optimized implementation. This commit also adds the optimized implementation for `ChildStdout` and `ChildStderr`.
2016-01-25std: Fix some behavior without stdio handlesAlex Crichton-1/+1
On all platforms, reading from stdin where the actual stdin isn't present should return 0 bytes as having been read rather than the entire buffer. On Windows, handle the case where we're inheriting stdio handles but one of them isn't present. Currently the behavior is to fail returning an I/O error but instead this commit corrects it to detecting this situation and propagating the non-set handle. Closes #31167
2015-12-30doc: missed these in a4da9acTshepang Lekhonkhobe-2/+2
2015-12-30doc: add gravesTshepang Lekhonkhobe-23/+23
2015-12-30doc: add some links for io::stdioTshepang Lekhonkhobe-14/+35
2015-12-23doc: make line visibleTshepang Lekhonkhobe-1/+1
2015-11-09std: Migrate to the new libcAlex Crichton-3/+2
* Delete `sys::unix::{c, sync}` as these are now all folded into libc itself * Update all references to use `libc` as a result. * Update all references to the new flat namespace. * Moves all windows bindings into sys::c
2015-10-31std: Prevent print panics when using TLSAlex Crichton-8/+26
Currently if a print happens while a thread is being torn down it may cause a panic if the LOCAL_STDOUT TLS slot has been destroyed by that point. This adds a guard to check and prints to the process stdout if that's the case (as we do for if the slot is already borrowed). Closes #29488