about summary refs log tree commit diff
path: root/src/libstd/io
AgeCommit message (Collapse)AuthorLines
2016-03-29Auto merge of #32541 - troplin:chain-bufread, r=alexcrichtonbors-0/+54
Implement BufRead for Chain Addresses #32536
2016-03-28Auto merge of #32461 - mitaa:rdoc-anchors, r=alexcrichtonbors-1/+1
rustdoc: Correct anchor for links to associated trait items fixes #28478 r? @alexcrichton
2016-03-28Fix formattingTobias Müller-2/+5
2016-03-28Use ? instead of try!, add some basic testsTobias Müller-1/+31
2016-03-28Implement BufRead for ChainTobias Müller-0/+21
2016-03-27Extend linkchecker with anchor checkingmitaa-1/+1
This adds checks to ensure that: * link anchors refer to existing id's on the target page * id's are unique within an html document * page redirects are valid
2016-03-24Rollup merge of #32276 - brson:doc, r=alexcrichtonSteve Klabnik-2/+2
doc: Stdin is not writable
2016-03-23doc: Stdin is locked for reads, not writesBrian Anderson-2/+2
2016-03-22try! -> ?Jorge Aparicio-17/+17
Automated conversion using the untry tool [1] and the following command: ``` $ find -name '*.rs' -type f | xargs untry ``` at the root of the Rust repo. [1]: https://github.com/japaric/untry
2016-03-13Auto merge of #32184 - ollie27:win_stdout, r=alexcrichtonbors-19/+2
Fixup stout/stderr on Windows 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-12std: Clean out deprecated APIsAlex Crichton-185/+0
Removes all unstable and deprecated APIs prior to the 1.8 release. All APIs that are deprecated in the 1.8 release are sticking around for the rest of this cycle. Some notable changes are: * The `dynamic_lib` module was moved into `rustc_back` as the compiler still relies on a few bits and pieces. * The `DebugTuple` formatter now special-cases an empty struct name with only one field to append a trailing comma.
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-10Auto merge of #32107 - Stebalien:partial-write, r=alexcrichtonbors-2/+32
Never return an error after a partial write If LineWriter fails to flush, return the number of bytes written instead of an error. Fixes #32085
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-03-07Add test case for #32085Steven Allen-0/+28
2016-03-07Never return an error after a partial writeSteven Allen-2/+4
If LineWriter fails to flush, return the number of bytes written instead of an error. Fixes #32085
2016-02-27Auto merge of #31914 - bluss:copy-from-slice-everywhere, r=alexcrichtonbors-4/+4
Use .copy_from_slice() where applicable .copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26Use .copy_from_slice() where applicableUlrik Sverdrup-4/+4
.copy_from_slice() does the same job of .clone_from_slice(), but the former is explicitly for Copy elements and calls `memcpy` directly, and thus is it efficient without optimization too.
2016-02-26Rollup merge of #31904 - bluss:writer-formatter-error, r=alexcrichtonManish Goregaokar-1/+8
Make sure formatter errors are emitted by the default Write::write_fmt Previously, if an error was returned from the formatter that did not originate in an underlying writer error, Write::write_fmt would return successfully even if the formatting did not complete (was interrupted by an `fmt::Error` return). Now we choose to emit an io::Error with kind Other for formatter errors. Since this may reveal error returns from `write!()` and similar that previously passed silently, it's a kind of a [breaking-change]. Fixes #31879
2016-02-26Make sure formatter errors are emitted by the default Write::write_fmtUlrik Sverdrup-1/+8
Previously, if an error was returned from the formatter that did not originate in an underlying writer error, Write::write_fmt would return successfully even if the formatting did not complete (was interrupted by an `fmt::Error` return). Now we choose to emit an io::Error with kind Other for formatter errors. Since this may reveal error returns from `write!()` and similar that previously passed silently, it's a kind of a [breaking-change].
2016-02-23Register new snapshotsAaron Turon-3/+3
2016-01-26Auto merge of #31120 - alexcrichton:attribute-deny-warnings, r=brsonbors-2/+2
This commit removes the `-D warnings` flag being passed through the makefiles to all crates to instead be a crate attribute. We want these attributes always applied for all our standard builds, and this is more amenable to Cargo-based builds as well. Note that all `deny(warnings)` attributes are gated with a `cfg(stage0)` attribute currently to match the same semantics we have today
2016-01-26Fix warnings during testsAlex Crichton-2/+2
The deny(warnings) attribute is now enabled for tests so we need to weed out these warnings as well.
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
2016-01-22Auto merge of #31070 - sfackler:bufreader-box-slice, r=alexcrichtonbors-2/+2
Saves a word, and also prevents the impl from accidentally changing the buffer length. r? @alexcrichton
2016-01-20Use a Box<[u8]> in BufReaderSteven Fackler-2/+2
Saves a word, and also prevents the impl from accidentally changing the buffer length.
2016-01-20Don't flush in BufWriter destructor after a panic in writeSteven Fackler-3/+40
We don't want to write the same data twice. Closes #30888
2016-01-16std: Stabilize APIs for the 1.7 releaseAlex Crichton-5/+8
This commit stabilizes and deprecates the FCP (final comment period) APIs for the upcoming 1.7 beta release. The specific APIs which changed were: Stabilized * `Path::strip_prefix` (renamed from `relative_from`) * `path::StripPrefixError` (new error type returned from `strip_prefix`) * `Ipv4Addr::is_loopback` * `Ipv4Addr::is_private` * `Ipv4Addr::is_link_local` * `Ipv4Addr::is_multicast` * `Ipv4Addr::is_broadcast` * `Ipv4Addr::is_documentation` * `Ipv6Addr::is_unspecified` * `Ipv6Addr::is_loopback` * `Ipv6Addr::is_unique_local` * `Ipv6Addr::is_multicast` * `Vec::as_slice` * `Vec::as_mut_slice` * `String::as_str` * `String::as_mut_str` * `<[T]>::clone_from_slice` - the `usize` return value is removed * `<[T]>::sort_by_key` * `i32::checked_rem` (and other signed types) * `i32::checked_neg` (and other signed types) * `i32::checked_shl` (and other signed types) * `i32::checked_shr` (and other signed types) * `i32::saturating_mul` (and other signed types) * `i32::overflowing_add` (and other signed types) * `i32::overflowing_sub` (and other signed types) * `i32::overflowing_mul` (and other signed types) * `i32::overflowing_div` (and other signed types) * `i32::overflowing_rem` (and other signed types) * `i32::overflowing_neg` (and other signed types) * `i32::overflowing_shl` (and other signed types) * `i32::overflowing_shr` (and other signed types) * `u32::checked_rem` (and other unsigned types) * `u32::checked_neg` (and other unsigned types) * `u32::checked_shl` (and other unsigned types) * `u32::saturating_mul` (and other unsigned types) * `u32::overflowing_add` (and other unsigned types) * `u32::overflowing_sub` (and other unsigned types) * `u32::overflowing_mul` (and other unsigned types) * `u32::overflowing_div` (and other unsigned types) * `u32::overflowing_rem` (and other unsigned types) * `u32::overflowing_neg` (and other unsigned types) * `u32::overflowing_shl` (and other unsigned types) * `u32::overflowing_shr` (and other unsigned types) * `ffi::IntoStringError` * `CString::into_string` * `CString::into_bytes` * `CString::into_bytes_with_nul` * `From<CString> for Vec<u8>` * `From<CString> for Vec<u8>` * `IntoStringError::into_cstring` * `IntoStringError::utf8_error` * `Error for IntoStringError` Deprecated * `Path::relative_from` - renamed to `strip_prefix` * `Path::prefix` - use `components().next()` instead * `os::unix::fs` constants - moved to the `libc` crate * `fmt::{radix, Radix, RadixFmt}` - not used enough to stabilize * `IntoCow` - conflicts with `Into` and may come back later * `i32::{BITS, BYTES}` (and other integers) - not pulling their weight * `DebugTuple::formatter` - will be removed * `sync::Semaphore` - not used enough and confused with system semaphores Closes #23284 cc #27709 (still lots more methods though) Closes #27712 Closes #27722 Closes #27728 Closes #27735 Closes #27729 Closes #27755 Closes #27782 Closes #27798
2016-01-15Auto merge of #30898 - petrochenkov:tvarfstab, r=alexcrichtonbors-3/+3
This wasn't done in https://github.com/rust-lang/rust/pull/29083 because attributes weren't parsed on fields of tuple variant back then. r? @alexcrichton
2016-01-14Require stability annotations on fields of tuple variantsVadim Petrochenkov-3/+3
2016-01-14Rollup merge of #30886 - ollie27:docs_links, r=steveklabnikManish Goregaokar-13/+13
r? @steveklabnik
2016-01-13Fix some broken and missing links in the docsOliver Middleton-13/+13
2016-01-12Remove dead `InternalBufWriter` implementationAndrea Canciani-15/+0
In 8d90d3f36871a00023cc1f313f91e351c287ca15 `BufStream`, the only consumer of `InternalBufWriter`, was removed. As implied by the name, this type is private, hence it is currently dead code.
2016-01-02Adjusted heading and created dedicated section in std::io docsNathan-0/+9
2016-01-01Auto merge of #30648 - tshepang:missing-graves, r=steveklabnikbors-2/+2
2015-12-31Auto merge of #30645 - tshepang:grammar, r=steveklabnikbors-2/+2
2015-12-30doc: missed these in a4da9acTshepang Lekhonkhobe-2/+2
2015-12-30doc: fix grammarTshepang 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-29Fix warnings when compiling stdlib with --testFlorian Hahn-3/+5
2015-12-26Fix links in docs for std::ioFlorian Hartwig-4/+4
2015-12-23doc: make line visibleTshepang Lekhonkhobe-1/+1
2015-12-18Use memchr in libstd where possible, closes #30076Florian Hahn-2/+4
2015-12-12Auto merge of #30312 - seanmonstar:ioerror-description, r=alexcrichtonbors-1/+23
cc @pnkfelix @alexcrichton
2015-12-10std: improve io error descriptionsSean McArthur-1/+23
2015-12-10std: Remove deprecated functionality from 1.5Alex Crichton-3/+0
This is a standard "clean out libstd" commit which removes all 1.5-and-before deprecated functionality as it's now all been deprecated for at least one entire cycle.
2015-12-09doc: these are just renames, so avoid duplicationTshepang Lekhonkhobe-7/+2
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-20/+52
This commit is the standard API stabilization commit for the 1.6 release cycle. The list of issues and APIs below have all been through their cycle-long FCP and the libs team decisions are listed below Stabilized APIs * `Read::read_exact` * `ErrorKind::UnexpectedEof` (renamed from `UnexpectedEOF`) * libcore -- this was a bit of a nuanced stabilization, the crate itself is now marked as `#[stable]` and the methods appearing via traits for primitives like `char` and `str` are now also marked as stable. Note that the extension traits themeselves are marked as unstable as they're imported via the prelude. The `try!` macro was also moved from the standard library into libcore to have the same interface. Otherwise the functions all have copied stability from the standard library now. * The `#![no_std]` attribute * `fs::DirBuilder` * `fs::DirBuilder::new` * `fs::DirBuilder::recursive` * `fs::DirBuilder::create` * `os::unix::fs::DirBuilderExt` * `os::unix::fs::DirBuilderExt::mode` * `vec::Drain` * `vec::Vec::drain` * `string::Drain` * `string::String::drain` * `vec_deque::Drain` * `vec_deque::VecDeque::drain` * `collections::hash_map::Drain` * `collections::hash_map::HashMap::drain` * `collections::hash_set::Drain` * `collections::hash_set::HashSet::drain` * `collections::binary_heap::Drain` * `collections::binary_heap::BinaryHeap::drain` * `Vec::extend_from_slice` (renamed from `push_all`) * `Mutex::get_mut` * `Mutex::into_inner` * `RwLock::get_mut` * `RwLock::into_inner` * `Iterator::min_by_key` (renamed from `min_by`) * `Iterator::max_by_key` (renamed from `max_by`) Deprecated APIs * `ErrorKind::UnexpectedEOF` (renamed to `UnexpectedEof`) * `OsString::from_bytes` * `OsStr::to_cstring` * `OsStr::to_bytes` * `fs::walk_dir` and `fs::WalkDir` * `path::Components::peek` * `slice::bytes::MutableByteVector` * `slice::bytes::copy_memory` * `Vec::push_all` (renamed to `extend_from_slice`) * `Duration::span` * `IpAddr` * `SocketAddr::ip` * `Read::tee` * `io::Tee` * `Write::broadcast` * `io::Broadcast` * `Iterator::min_by` (renamed to `min_by_key`) * `Iterator::max_by` (renamed to `max_by_key`) * `net::lookup_addr` New APIs (still unstable) * `<[T]>::sort_by_key` (added to mirror `min_by_key`) Closes #27585 Closes #27704 Closes #27707 Closes #27710 Closes #27711 Closes #27727 Closes #27740 Closes #27744 Closes #27799 Closes #27801 cc #27801 (doesn't close as `Chars` is still unstable) Closes #28968
2015-11-18Add missing annotations and some testsVadim Petrochenkov-0/+11