summary refs log tree commit diff
path: root/src/libstd/io/error.rs
AgeCommit message (Collapse)AuthorLines
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-13Better Debug impl for io::Error.Clar Charr-8/+35
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-2/+2
Like #43008 (f668999), but _much more aggressive_.
2017-08-10Add missing links for Error docsGuillaume Gomez-1/+4
2017-08-10Add missing links in io::Error docsGuillaume Gomez-7/+11
2017-06-04inline io::Error creation from ErrorKindarthurprs-0/+1
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-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-1/+1
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-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-02Add missing urls for ErrorKind's variantsGuillaume Gomez-2/+7
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-08-31Rollup merge of #35911 - tbu-:pr_io_errorkind_traits, r=alexcrichtonJonathan Turner-2/+3
Implement more traits for `std::io::ErrorKind` This makes it possible to use it as key in various maps.
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-5/+0
2016-08-24Restore old ordering of `io::ErrorKind`sTobias Bucher-3/+4
2016-08-23Implement more traits for `std::io::ErrorKind`Tobias Bucher-6/+6
This makes it possible to use it as key in various maps.
2016-07-30Add urls in std::io typesGuillaume Gomez-1/+7
2016-07-29Add io::Error doc examplesGuillaume Gomez-0/+145
2016-07-06Add doc examples for `io::Error::from_raw_os_error`.Corey Farwell-0/+24
2016-05-03Remove unused trait imports flagged by lintSeo Sanghyeon-1/+0
2016-03-12std: Clean out deprecated APIsAlex Crichton-8/+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.
2015-12-29Fix warnings when compiling stdlib with --testFlorian Hahn-1/+1
2015-12-10std: improve io error descriptionsSean McArthur-1/+23
2015-12-09doc: these are just renames, so avoid duplicationTshepang Lekhonkhobe-6/+1
2015-12-05std: Stabilize APIs for the 1.6 releaseAlex Crichton-1/+13
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-10-14fix tidyManish Goregaokar-1/+1
2015-10-14fix link on std::result::ResultVladimir Rutsky-3/+2
The link is broken here: <https://doc.rust-lang.org/std/io/#types>. Looks like crate documentation generator uses only first paragraph of the module documentation and so doesn't resolve the link defined below.
2015-09-14Auto merge of #28256 - petrochenkov:conv, r=alexcrichtonbors-1/+5
This patch transforms functions of the form ``` fn f<Generic: AsRef<Concrete>>(arg: Generic) { let arg: &Concrete = arg.as_ref(); // Code using arg } ``` to the next form: ``` #[inline] fn f<Generic: AsRef<Concrete>>(arg: Generic) { fn f_inner(arg: &Concrete) { // Code using arg } f_inner(arg.as_ref()); } ``` Therefore, most of the code is concrete and not duplicated during monomorphisation (unless inlined) and only the tiny bit of conversion code is duplicated. This method was mentioned by @aturon in the Conversion Traits RFC (https://github.com/rust-lang/rfcs/blame/master/text/0529-conversion-traits.md#L249) and similar techniques are not uncommon in C++ template libraries. This patch goes to the extremes and applies the transformation even to smaller functions<sup>1</sup> for purity of the experiment. *Some of them can be rolled back* if considered too ridiculous. <sup>1</sup> However who knows how small are these functions are after inlining and everything. The functions in question are mostly `fs`/`os` functions and not used especially often with variety of argument types, so the code size reduction is rather small (but consistent). Here are the sizes of stage2 artifacts before and after the patch: https://gist.github.com/petrochenkov/e76a6b280f382da13c5d https://gist.github.com/petrochenkov/6cc28727d5256dbdfed0 Note: All the `inner` functions are concrete and unavailable for cross-crate inlining, some of them may need `#[inline]` annotations in the future. r? @aturon
2015-09-09Reduce code bloat from conversion traits in function parametersVadim Petrochenkov-1/+5
2015-09-08some more clippy-based improvementsAndre Bogus-3/+3
2015-08-30Auto merge of #27588 - cesarb:read_all, r=alexcrichtonbors-0/+9
This implements the proposed "read_exact" RFC (https://github.com/rust-lang/rfcs/pull/980). Tracking issue: https://github.com/rust-lang/rust/issues/27585
2015-08-28Add issue number to read_exact unstable declarationsCesar Eduardo Barros-1/+1
2015-08-24Implement read_exact for the Read traitCesar Eduardo Barros-0/+9
This implements the proposed "read_exact" RFC (https://github.com/rust-lang/rfcs/pull/980).
2015-08-19Improve std::io::ErrorKindSteve Klabnik-0/+3
Hopefully make this distinction a little more clear. Fixes #27637
2015-08-15std: Add issues to all unstable featuresAlex Crichton-1/+2
2015-07-28std: Stabilize a number of small APIsAlex Crichton-9/+6
The following APIs were all marked with a `#[stable]` tag: * process::Child::id * error::Error::is * error::Error::downcast * error::Error::downcast_ref * error::Error::downcast_mut * io::Error::get_ref * io::Error::get_mut * io::Error::into_inner * hash::Hash::hash_slice * hash::Hasher::write_{i,u}{8,16,32,64,size}
2015-07-10Add more std::io documentation.Steve Klabnik-3/+29
This round: io::Result and the free functions.
2015-06-19Add a test for Debug for io::ErrorPeter Atashian-0/+10
Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-06-18Custom Debug impl for io::ErrorPeter Atashian-1/+11
Fixes #26408 Signed-off-by: Peter Atashian <retep998@gmail.com>
2015-06-17std: Split the `std_misc` featureAlex Crichton-1/+1
2015-05-30std::io: bump the stability tag on ErrorKind::InvalidData to 1.2.0Mikhail Zabaluev-1/+1
2015-05-29std::io: New ErrorKind value InvalidDataMikhail Zabaluev-0/+7
This takes the cases from InvalidInput where a data format error was encountered. This is different from the documented semantics of InvalidInput, which more likely indicate a programming error.
2015-05-28Mention UFCS sadness in instability messagesSteven Fackler-3/+6
2015-05-27Add a test for downcastingSteven Fackler-2/+38
Ergonomics are a bit crappy right now because method resolution isn't smart enough to drop bounds, unfortunately.
2015-05-27Add accessors for io::Error's inner error.Steven Fackler-6/+42
error::Error itself has downcasting methods, so there's no need to duplicate those here.
2015-05-27Delegate io::Error::cause to inner errorSteven Fackler-0/+7
2015-04-21std: Remove deprecated/unstable num functionalityAlex Crichton-7/+0
This commit removes all the old casting/generic traits from `std::num` that are no longer in use by the standard library. This additionally removes the old `strconv` module which has not seen much use in quite a long time. All generic functionality has been supplanted with traits in the `num` crate and the `strconv` module is supplanted with the [rust-strconv crate][rust-strconv]. [rust-strconv]: https://github.com/lifthrasiir/rust-strconv This is a breaking change due to the removal of these deprecated crates, and the alternative crates are listed above. [breaking-change]
2015-04-18Auto merge of #24133 - kballard:add-sync-to-io-error, r=alexcrichtonbors-3/+8
This allows `io::Error` values to be stored in `Arc` properly. Because this requires `Sync` of any value passed to `io::Error::new()` and modifies the relevant `convert::From` impls, this is a [breaking-change] Fixes #24049.
2015-04-13pluralize doc comment verbs and add missing periodsAndrew Paseltiner-1/+1
2015-04-08std: Stabilize io::Error::from_raw_os_errorAlex Crichton-3/+9
This commit stabilizes the old `io::Error::from_os_error` after being renamed to use the `raw_os_error` terminology instead. This function is often useful when writing bindings to OS functions but only actually converting to an I/O error at a later point.